解题思路:
注意事项:
参考代码:
#include<iostream> #include<cmath> #include<bits/stdc++.h> using namespace std; void Compare(int a,int b) { cout<<(a>b?a:b)<<endl; } void Compare(char c1,char c2) { cout<<abs((int)(c1-c2))<<endl; } void Compare(const string &str1,const string &str2) { if(str1>str2) cout<<str1<<endl; else cout<<str2<<endl; } int main() { int a,b; char c1,c2; string str1,str2; cin>>a>>b>>c1>>c2>>str1>>str2; Compare(a,b); Compare(c1,c2); Compare(str1,str2); return 0; }
0.0分
0 人评分
矩形面积交 (Java代码)浏览:1214 |
【蟠桃记】 (C语言代码)浏览:649 |
【简单计算】 (C语言代码)浏览:622 |
【蟠桃记】 (C语言代码)浏览:664 |
众数问题 (C语言代码)浏览:829 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:830 |
The 3n + 1 problem (C语言代码)浏览:552 |
交换Easy (C语言代码)浏览:761 |
敲七 (C语言代码)浏览:2700 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:548 |