int main() { int tmp; int sBuf[64]; int i = 0; int j = 0; printf("输入三个整数:\n"); for (i=0; i<3; i++) { scanf("%d",&sBuf[i]); } for (i=0; i<3; i++) { if (sBuf[i]>sBuf[i+1]) { tmp = sBuf[i]; } else tmp = sBuf[i+1]; } printf("最大数%d",tmp); }
柒槿年
2024-09-02 12:45:16
#include<iostream> using namespace std;
int main() { int a,b,c,max; cin>>a>>b>>c; if(a>b) max=a; else max=b;
if( max<c ) max = c; cout<<max<<endl; return 0; }
一见钟情我相信
2024-09-02 22:41:24
#include <iostream> using namespace std; int main() { int a, b, c,max; cin >> a; cin >> b; cin >> c;