사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
1193번 분수 찾기
GamJia 2023. 3. 29. 20:03
단계별로 풀어보기 - 기본 수학 1 - 3단계
https://www.acmicpc.net/problem/1193
#include <iostream> using namespace std; int main() { int N,i; cin>>N; int count=1; for(i=1;N>count;i++) { count+=i+1; } if(i%2==0) { cout<<i-(count-N)<<"/"<<1+(count-N); } else { cout<<1+(count-N)<<"/"<<i-(count-N); } return 0; }