[백준 17903] Counting Clauses (C#, C++) - soo:bak
작성일 :
문제 링크
설명
절의 수에 따라 satisfactory 또는 unsatisfactory를 판단하는 문제입니다.
접근법
절의 수가 8 이상이면 satisfactory, 미만이면 unsatisfactory를 출력합니다.
실제 리터럴 내용은 결과에 영향을 주지 않으므로 첫 줄만 읽으면 됩니다.
Code
C#
1
2
3
4
5
6
7
8
9
using System;
class Program {
static void Main() {
var line = Array.ConvertAll(Console.ReadLine()!.Split(), int.Parse);
var m = line[0];
Console.WriteLine(m >= 8 ? "satisfactory" : "unsatisfactory");
}
}
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int m, n;
if (!(cin >> m >> n)) return 0;
cout << (m >= 8 ? "satisfactory" : "unsatisfactory") << "\n";
return 0;
}
```