#include<stdio.h>
int main( ) {
int i=1;
while(1){
printf(“第%d只羊\n”,i);
i++;}
return 0;
}
#include<stdio.h>
#include<Windows.h>
int main( ) {
int i=1;
while(i<=100){
printf(“第%d只羊\n”,i);
Sleep(1000);
i++;}
printf(“我睡着了…”);
return 0;}
#include<stdio.h>
#include<Windows.h>
int main( ) {
int i;
for(i=1;i<=5;i++){
printf(“吃第%d个饺子\n”,i);
Sleep(1000);}
printf(“吃饱了!\n”);
return 0;
}
#include<stdio.h>
int main( ) {
int i,j,n;
printf(“请输入金字塔层数:”);
scanf("%d",&n);
for(i=1;i<=n;i++){
for(j=0;j<=n-i;j++)
{printf(" “);}
for(j=0;j<2i-1;j++){
printf("”);}
printf("\n");
}
return 0;
}
#include<stdio.h>
int main( ) {
int i,j,n;
for(i=1;i<=9;i++){
for(j=1;j<=i;j++){
printf("%d*%d=%d\t",i,j,i*j);}
printf("\n");
}
return 0;
}
#include<stdio.h>
#include<string.h>
int main( ) {
int i,len,n,tmp;
char buff[256];
printf(“请输入一个字符串:”);
gets(buff);
printf(“您输入的是:%s\n”,buff);
len=strlen(buff);
n=len/2;
for(i=0;i<n;i++){
tmp=buff[i];
buff[i]=buff[len-1-i];
buff[len-1-i]=tmp;}
printf(“逆转以后:%s\n”,buff);
return 0;
}