current position:Home>Lesson 33 challenge arena "interesting C + + programming for primary school students"

Lesson 33 challenge arena "interesting C + + programming for primary school students"

2022-01-26 22:15:06 dllglvzhenfeng

/*
 Try to make a program , Input 10 Number , Output the largest number .
*/
#include<iostream>
using namespace std;
int main()
{
	//freopen("max.in","r",stdin);
	//freopen("max.out","w",stdout);
	float max,x;
	int i;
	
	cout<<" Please enter the first 1 Number :";             
	cin>>x;
	
	max=x;
	
	for(i=2;i<=10;i++)
	{
		cout<<" Please enter the first "<<i<<" Number :";   
		cin>>x;
		if(x>max) max=x;
	}
	
	cout<<" The biggest number :"<<max;
	
	//fclose(stdin);
	//fclose(stdout);
	 
	return 0;
}
/*
 Homework 
1.1.4  Logical expressions and conditional branches of programming basis  16: Triangle judgment 
http://noi.openjudge.cn/ch0104/16/ 
*/

 


 

 

 

copyright notice
author[dllglvzhenfeng],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201262215050928.html

Random recommended