if
文の練習問題。
問題概要
整数 が与えられる。
- ならば "ABC"
- ならば "ARC"
を出力せよ。
解法
if
文で処理を分岐すれば OK。
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x < 1200) cout << "ABC" << endl; else cout << "ARC" << endl; }
if
文の練習問題。
整数 が与えられる。
を出力せよ。
if
文で処理を分岐すれば OK。
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (x < 1200) cout << "ABC" << endl; else cout << "ARC" << endl; }