Recent Posts
Notice
No Rules Rules
369 (feat. 백준, 17614번) 본문
728x90
반응형
369
https://www.acmicpc.net/problem/17614
17614번: 369
민수는 같은 반 친구들과 369게임을 하고 있다. 369게임은 여러 명이 원형으로 둘러 앉아 시작 위치의 사람이 1을 외치며 시작된다. 이후 시계방향으로 돌아가며 2, 3, 4와 같이 1씩 증가된 수가 자
www.acmicpc.net
// woohyeon.kim
// kim519620.tistory.com
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(NULL);
register int N, ans = 0;
cin >> N;
for(register int n = 1, v; n <= N; ++n){
v = n;
while(v){
auto t = v % 10;
if(t == 3 || t == 6 || t == 9)
++ans;
v /= 10;
}
}
cout << ans;
return 0;
}
// *&)*@*
반응형
단순 연산 문제입니다.
728x90
반응형
'생활 > 코테' 카테고리의 다른 글
돌 게임 3 (feat. 백준, 9657번) (0) | 2022.11.03 |
---|---|
상범 빌딩 (feat. 백준, 6593번) (0) | 2022.11.03 |
성곽 (feat. 백준, 2234번) (0) | 2022.11.03 |
국회의원 선거 (feat. 백준, 1417번) (0) | 2022.11.03 |
트럭 주차 (feat. 백준, 2979번) (0) | 2022.11.03 |
Comments