L1-051
思路:
按规格输出即可
代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
int x, y;
cin >> x >> y;
printf("%.2f", x * y * 0.1);
return 0;
}
L1-052
思路:
按要求输出即可
代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
cout << 2018 << '
';
cout << "wo3 men2 yao4 ying2 !";
return 0;
}
L1-053
思路:
加起来输出即可
代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
string s = "Wang!";
int a, b;
cin >> a >> b;
while(a--) cout << s;
while(b--) cout << s;
return 0;
}
L1-054
思路:
上下左右倒过来输出即可
代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
#ifdef MyTest
freopen("Sakura.txt", "r", stdin);
#endif
char c;
int n;
scanf("%c %d", &c, &n); getchar();
vector<string> a(n), b(n);
for(int i = 0; i < n; i++){
getline(cin, a[i]);
while(a[i].length() != n) a[i] += ' ';
}
bool flag = true;
for(int i = 0; i < n; i++){
b[i] = a[n - i - 1];
reverse(b[i].begin(), b[i].end());
if(b[i] != a[i]) flag = false;
}
if(flag) puts("bu yong dao le");
for(string & s : b){
for(char & x : s){
if(x == '@') putchar(c);
else putchar(' ');
}
putchar('
');
}
return 0;
}
L1-055
思路:
简单判断下即可
代码:
#include<bits/stdc++.h>
using namespace std;
int main() {
int x, y, a, b, c;
cin >> x >> y >> a >> b >> c;
if( x > y && (!a || !b || !c) ) printf("The winner is %c: %d + %d", 'a', x, 3 - a - b - c);
else printf("The winner is %c: %d + %d", 'b', y, a + b + c);
return 0;
}