编程练习
1、#include<stdio.h>
int main (void)
{
printf("Yang Zheng\n");
printf("Yang\n");
printf("Zheng\n");
printf("Yang Zheng\n");
return 0;
}
2、#include<stdio.h>
int main (void)
{
printf("Zheng Yang fujiansheng ningdeshi\n");
return 0;
}
3、#include<stdio.h>
int main (void)
{
int year;
printf("你的年龄:");
scanf("%d",&year);
printf("%d年总共是%d天\n",year,365*year);
return 0;
}
4、#include<stdio.h>
void jolly();
int main (void)
{
jolly();
printf("Which nobody can deny!\n");
return 0;
}
void jolly()
{
printf("For he's a jolly good fellow!\n");
printf("For he's a jolly good fellow!\n");
printf("For he's a jolly good fellow!\n");
}
5、#include<stdio.h>
void br();
void ic();
int main (void)
{
br();
ic();
printf("Brazil, Russia\n");
return 0;
}
void br()
{
printf("Brazil, Russia, India, China\n");
}
void ic()
{
printf("India, China\n");
}
6、#include<stdio.h>
int main (void)
{
int toes,t2,tsquare;
toes = 10;
t2 = 2*toes;
tsquare = toes*toes;
printf("%d的两倍是%d,平方是%d\n",toes,t2,tsquare);
return 0;
}
7、#include<stdio.h>
void br();
int main (void)
{
br();
br();
printf("Smile!\n");
return 0;
}
void br()
{
printf("Smile!Smile!Smile!\n");
}
8、#include<stdio.h>
void one_three();
void two();
int main (void)
{
printf("starting now:\n");
one_three();
printf("done!\n");
return 0;
}
void one_three()
{
printf("one\n");
two();
printf("three\n");
}
void two()
{
printf("two\n");
}