2964: 循环入门-计算 1~n 中既不能被 3 也不能被 5 整除的数的和
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:10
Solved:7
Description
输入正整数n,用for循环遍历 1~n,通过if判断既不能被 3 也不能被 5 整除的数,计算并输出这些数的总和。
Input
一个正整数n;
Output
符合条件的数的总和(整数);
Sample Input Copy
10
Sample Output Copy
22
HINT
数据范围:1 ≤ n ≤ 1000。