10000 Update 1193.cpp · Dolarge/basic-algo-lecture@ecf2fc8 · GitHub
[go: up one dir, main page]

Skip to content

Commit ecf2fc8

Browse files
author
SciEm
committed
Update 1193.cpp
1 parent 816221b commit ecf2fc8

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

0x12/solutions/1193.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : SciEm
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/037f3a0f8454498d8b609d819fd67398
44
#include <bits/stdc++.h>
55
using namespace std;
66

7-
int main(void){
7+
int main() {
88
ios::sync_with_stdio(0);
99
cin.tie(0);
10-
11-
}
10+
11+
int x; cin >> x;
12+
13+
int i = 1;
14+
while (x > i) x -= i++;
15+
16+
int nume = x;
17+
int deno = i + 1 - x;
18+
if (i % 2) swap(nume, deno);
19+
cout << nume << '/' << deno;
20+
}

0 commit comments

Comments
 (0)
0