c primer plus 6.5
代码语言:javascript复制#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;
}