1/232

西工大NOJ.doc

0/100

“1“的传奇
A+B
A+BⅡ
AB
ACKERMAN
Arithmetic Progressions
Bee
Checksum algorithm
Coin Test
Dexter need help
Double
Easy problem
Favorite number
Graveyard
Hailstone
Hanoi Ⅱ
Houseboat
poser
Redistribute wealth
Scoring
Specialized Numbers
Sticks
Sum of Consecutive
Symmetric Sort
The Clock
The Ratio of gainers to losers
VOL大学乒乓球比赛

“1“的传奇
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int n,i,j,k=0,x=1,y,z,m,p,q,a,s=0;
scanf("%d",&n);
m=n;
for(i=1;i<12;i++)
{
m=m/10;
k++;
if(m==0)
break;
}
q=n;
k=k-1;
for(a=1;a<=k;a++)
{
x=x*10;
}
y=q%x;
z=q/x;
p=q-y;
if(z>=2)
s=s+x+z*k*(x/10);
else
s=s+z*k*(x/10);
for(j=p;j<=n;j++)
{
m=j;
for(i=1;i<12;i++)
{
x=m%10;
if(x==1)
s++;
m=m/10;
if(m==0)
break;
}
}
printf("%d",s);
return 0;
}
A+B
#include <stdio.h>
int doubi(int n,int m)
{
n=n+m;
n=n%100;
return n;
}
int main()
{
int t,i,a[100],n,m;
scanf("%d",&t);
for (i=0;i<=(t-1);i++){
scanf("%d%d",&n,&m);
a[i]=doubi(n,m);
}
for (i=0;i<=(t-1);i++)
printf("%d\n",a[i]);
return 0;
} 内容来自淘豆网www.taodocs.com转载请标明出处.