#include<stdio.h>
int main()
{int i,j;
for(i=1;i<=9;i++)
{for(j=1;j<=i;j++)
{
printf("%d*%d=%-2d ",i,j,i*j);
}
printf("\n");}
return 0;}
#include<stdio.h>
int main()
{int i,j;
for(i=1;i<=9;i++)
{for(j=1;j<=i;j++)
{
printf("%d*%d=%-2d ",i,j,i*j);
}
printf("\n");}
return 0;}
#include<stdio.h>
int main()
{ int i,arr[]={3,34,45,54,66,75,43,53,21,32},max=arr[0],sz;
sz=sizeof(arr)/sizeof(arr[0]);
for(i=1;i<=sz;i++)
{if(arr[i]>max)
max=arr[i];
}
printf("%d",max);
return 0;
}
#include<stdio.h>
int main()
{ int i,arr[]={3,34,45,54,66,75,43,53,21,32},max=arr[0];
for(i=1;i<=9;i++)
{if(arr[i]>max)
max=arr[i];
}
printf("%d",max);
return 0;
}
#include<stdio.h>
int main()
{int i,k=1;
double sum=0.0;
for(i=1;i<=100;i++)
{sum=sum+k*1.0/i;
k=-k;}
printf( " %lf",sum);
return 0;
}
#include<stdio.h>
int main()
{ int i,count=0;
for(i=1;i<100;i++)
{ if(i%10==9)
{
printf( " %d",i);
count++;}
if(i/10==9)
printf(" %d",i);
count++;
}
printf(" \ncount=%d",count);
return 0;
}
#include<stdio.h>
int main()
{int i,j,count;
for(i=100;i<=200;i++)
{for(j=2;j<i;j++)
{if(i%j==0)break;
}
if(i==j)
{printf(" %d",i);
count++;
}
}
printf(" \ncount=%d",count);
return 0;
}
#include<stdio.h>
int main()
{int a,b,c,k;
scanf("%d %d %d",&a,&b,&c);
if(b>a)
{
k=b;
b=a;
a=k;}
if(c>b)
{k=c;
c=b;
b=k;
}
if(a<c)
k=c;
c=b;
b=a;
a=c;
printf("%d %d %d",a,b,c);
return 0;
}
#include<stdio.h>
int main()
{ int year,count=0;
for(year=1000;year<=2000;year++)
{
if(year%4==0&&year%100!=0)
{
printf(" %d",year);
count++;}
else if (year%400==0)
{
printf(" %d",year);
count++;
}
}printf("\n count=%d",count);
return 0;}