#94. 数论第六题(NOIP2014)

数论第六题(NOIP2014)

第六题(NOIP2014)

#include<iostream>
using namespace std;
int main(){
    int a,b,i,tot,c1,c2;
    cin>>a>>b;
    tot=0;
    for(i=a;i<=b;i++){
        c1=(i/10)%10;
        c2=i%10;
        if((c1+c2)%3==0)tot++;
    }
    cout<<tot<<endl;
    return 0;
}
  1. 【判断题】将第6行去掉会导致运行错误。
    {{ select(1) }}
  • 正确
  • 错误
  1. 【判断题】将第4行去掉会导致编译错误。
    {{ select(2) }}
  • 正确
  • 错误
  1. 【判断题】若a,b都是99以内的整数,将第8行替换为"c1 = i / 10"没有影响。
    {{ select(3) }}
  • 正确
  • 错误
  1. 【判断题】若a,b都是99以内的整数,则答案为区间[a,b]中3的倍数的数量。
    {{ select(4) }}
  • 正确
  • 错误
  1. 【选择题】输入1 100,则输出( )。
    {{ select(5) }}
  • 31
  • 32
  • 33
  • 34
  1. 【选择题】输入1 10000,则输出( )。
    {{ select(6) }}
  • 3333
  • 3400
  • 258
  • 1950