我是靠谱客的博主 快乐鸡,这篇文章主要介绍c++ primer plus 6.5,现在分享给大家,希望可以做个参考。

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++内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(128)

评论列表共有 0 条评论

立即
投稿
返回
顶部