#include<iostream>
using namespace std;
int main() {
int x;
cin >> x;
cout << "Today, I ate " << x << " apple";
if (x > 1) {
// if (x != 0 && x != 1){
cout << "s" << endl;
}
return 0;
}
#include<iostream>
using namespace std;
int main () {
int x;
cin >> x;
if ((11 + 3 * x) > (5 * x)) cout << "Local" << endl; else cout << "Luogu" << endl;
return 0;
}
#include<iostream>
using namespace std;
int main () {
char opt;
cin >> opt;
switch (opt) {
case 'G': cout << "Hello, my master!" << endl;
case 'N': cout << "I'm Xiaoluo." << endl; break;
case 'S': cout << "Teinei teinei teinei~" << endl; break;
case 'B': case 'Q': cout << "Bye bye!" << endl; break;
default: cout << "Sorry.." << endl;
}
return 0;
}
#include<iostream>
using namespace std;
int main() {
double m, h, BMI;
cin >> m >> h;
BMI = m / h / h;
if (BMI < 18.5)
cout << "Underweight";
else if (BMI < 24)
cout << "Normal";
else {
cout << BMI << endl;
cout << "Overweight" << endl;
}
return 0;
}
#include<iostream>
using namespace std;
int main() {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
if (a <= b && b <= c) printf("%d %d %d\n", a, b, c);
else if (a <= c && c <= b) printf("%d %d %d\n", a, c, b);
else if (b <= a && a <= c) printf("%d %d %d\n", b, a, c);
else if (b <= c && c <= a) printf("%d %d %d\n", b, c, a);
else if (c <= a && a <= b) printf("%d %d %d\n", c, a, b);
else printf("%d %d %d\n", c, b, a);
return 0;
}
#include<iostream>
using namespace std;
int main() {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
if (a >= b && a >= c) {
if (b >= c) printf("%d %d %d", c, b, a);
else printf("%d %d %d", b, c, a);
}
else if (b >= a && b >= c) {
if (a >= c) printf("%d %d %d", c, a, b);
else printf("%d %d %d", a, c, b);
}
else if (c >= b && c >= a) {
if (a >= b) printf("%d %d %d", b, a, c);
else printf("%d %d %d", a, b, c);
}
return 0;
}
C++入门同步记录#6
最新推荐文章于 2024-04-29 22:13:34 发布