C++) #include #include using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(nullptr); int day, temp; cin >> day; vector v; for (int i = 0; i > temp; v.push_back(temp); } int ans = 0; for (auto ele : v) { if (ele == day) ans += 1; } cout
C++) #include #include using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(nullptr); int x; cin >> x; int i = 1; int sum = 1; while (sum < x) { i += 1; sum += i; } int pos = x - ((i - 1) * i / 2); string ans; if (i % 2 == 0) ans = to_string(pos) + "/" + to_string(i + 1 - pos); else ans = to_string(i + 1 - pos) + "/" + to_string(pos); cout
C++) #include #include using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int h, w, n; cin >> h >> w >> n; int floor = n % h; int room = n / h; if (floor == 0) { if (room < 10) cout
C++) import sys n = int(sys.stdin.readline().rstrip()) def SumOfDigits(n): sum = 0 while n > 0: sum += (n%10) n//=10 return sum sum = SumOfDigits(n) if n%sum != 0: while True: n+=1 sum = SumOfDigits(n) if n % sum == 0: break print(n) Python) #include using namespace std; int SumOfDigits(int n) { int temp = n; int sum = 0; while (temp > 0) { sum += (temp % 10); temp /= 10; } return sum; } int mai..
C++) #include #include using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while (t--) { int n, temp; cin >> n; vector v; for (int i = 0; i > temp; v.push_back(temp); } int ans = 0; for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) { if (v[j]