c++ primer plus 6.5
#include <stdio.h>
#include <iostream>
using namespace std;
int main(void) {
float temp;
float value[6];
cout<<"请输入数字"<<endl;
int i=0;
cout<<"first value"<<endl;
cin>>temp;
while(i<6&&temp>=0){
value[i]=temp;
i++;
if(i<6){
cout<<"next value"<<endl;
cin>>temp;
}
}
if(i==0) {
cout<<"nodata byebye!"<<endl;
}else{
cout<<"enter your data:"<<endl;
float level;
cin>>level;
int count=0;
for(int j=0;j<i;j++){
if(value[j]>level)count++;
}
cout<<count<<"your neighours have the new age for you"<<endl;
}
return 0;
}
最后
以上就是快乐鸡最近收集整理的关于c++ primer plus 6.5的全部内容,更多相关c++内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复