解题思路:
注意事项:
参考代码:
#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 人评分
C语言训练-舍罕王的失算 (C++代码)(都给答案了还算什么)浏览:972 |
C二级辅导-分段函数 (C语言代码)浏览:558 |
母牛的故事 (C语言代码)浏览:736 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:451 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:879 |
【魔板】 (C++代码)(时间超限,希望会的帮我改正一下)浏览:738 |
1908题解浏览:633 |
1011题解浏览:760 |
回文数字 (C语言代码)浏览:2509 |
C语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:672 |