问题描述
问题分析
那时候写的有点麻烦
不过也没超时……
就这样吧~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| #include<stdio.h>
int main() {
int i,t,n,m,x;
scanf("%d %d",&n,&m);
for(i=n,x=0; i<=m; i++) {
t=i;
while(t/10!=0) {
if(t%10==1)
x++;
t/=10;
}
if(t==1)
x++;
}
printf("%d",x);
return 0;
}
|
题目地址:【郑轻】[1759]Double eleven