本文共 554 字,大约阅读时间需要 1 分钟。
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr(); //to clear the screen
int i,n,x,large=0;
cout<<“How many numbers?”;
cin>>n;
for(i=0;i<n;++i)
{
cout<<“nEnter number “<<i+1<<“:”;
cin>>x;
if(x>large)
large=x;
}
cout<<“nnThe largest number is “<<large;
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr(); //to clear the screen
int i,n,x,large=0;
cout<<“How many numbers?”;
cin>>n;
for(i=0;i<n;++i)
{
cout<<“nEnter number “<<i+1<<“:”;
cin>>x;
if(x>large)
large=x;
}
cout<<“nnThe largest number is “<<large;
getch();
}
翻译自:
转载地址:http://irwwd.baihongyu.com/