#include<iostream>usingnamespace std;intmain(){int max =0;int position ;for(int i =1;i <=100;i ++)//位置从1开始算起{int x;
cin >> x;if(x > max){
max = x;
position = i;}}
cout << max << endl;
cout << position << endl;return0;}
#include<iostream>#include<algorithm>usingnamespace std;intmain(){int n;
cin >> n;// 读取n对测试数据while(n--)// 进行 N 次测试{int a,b;
cin >> a >> b;if(a > b)swap(a,b);int s =0;for(int i = a +1; i < b; i ++)if(i %2)
s += i;
cout << s << endl;}return0;}
#include<iostream>usingnamespace std;intmain(){int n;
cin >> n;int a =0,b =1;for(int i =0;i < n;i ++){
cout << a <<' ';int c = a + b;
a = b;
b = c;}
cout << endl;return0;}
#include<iostream>usingnamespace std;intmain(){int a,b;while(cin >> a >> b,a >0&& b >0)// 输入时就进行判断{if(a > b)swap(a,b);int sum =0;for(int i = a;i<= b;i++){
sum += i;
cout << i <<' ';}
cout<<"Sum="<<sum<<endl;}return0;}
#include<iostream>#include<cstdio>usingnamespace std;intmain(){int n;
cin >> n;while(n --)// 对 n 个数进行判断{int x;
cin >> x;int s =0;for(int i =1; i * i <= x; i ++)if(x % i ==0)// 说明i是约数{if(i < x) s += i;if(i != x / i && x / i < x) s += x / i;}if(s == x)printf("%d is perfect\n", x);elseprintf("%d is not perfect\n", x);}return0;}
#include<iostream>#include<cstdio>usingnamespace std;intmain(){int n;
cin >> n;while(n--){int a;
cin >> a;bool is_prime =true;for(int i =2;i*i <= a;i++){if(a % i ==0){
is_prime =false;break;}}if(is_prime)
cout<< a <<" is prime"<<endl;else
cout<< a <<" is not prime"<<endl;}return0;}