(水题) Div 3 -- SGU -- 105

时间:2024-06-19 15:33:50

链接:

http://vj.acmclub.cn/contest/view.action?cid=168#problem/E

时限:250MS     内存:4096KB     64位IO格式:%I64d & %I64u
提交 状态 练习 SGU 105

问题描述

There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3.

Input

Input contains N (1<=N<=231 - 1).

Output

Write answer to the output.

Sample Input

4

Sample Output

2

还以为是每位数代表一个数呢!唉,题没懂

代码:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<queue> using namespace std; const long long MOD = ; int main()
{
int n; while(scanf("%d", &n), n)
{
int sum = n/*;
if(n%==)
sum ++; printf("%d\n", sum);
}
return ;
}