不多说了,请各位高手帮帮忙!
1.
#include <stdio.h>
main()
{printf("a_bc\td\re\t_f\n");
printf("gh_\tij_\b\b _ _k");
}注:“_”代表一个空格。
运行结果为:
e_ _ _ _ _ _ _ _f
gh_ _ _ _ _ _ i_ _k
2.
#include <stdio.h>
main()
{
char c1=’a’,c2=’b’,c3=’c’;
printf("\na%cb%cc%c ",c1,c2,c3);
}
运行结果为:
3.
#include <stdio.h>
main()
{
int z, x=6,y=5;
char w=’c’;
z=x+y+w;
printf("\n%d,%d,%d",x,y,z);
}
运行结果为:
4.
#include <stdio.h>
main()
{ int i=128;
float x=234.89;
printf(“\n”);
printf("%5d,%8.2f\n",i,x);
printf("%2d,%4.1f\n",i,x);
}
运行结果为:
5.
#include <stdio.h>
main()
{int x=15,y=5;
float f=1234.567,b=12345;
printf(“%f_ _%10f_%10.2f_%.2f_%-10.2f\n”,f,f,f,f,f);
printf("%-8.3f\n ",f,);
printf("x+y=%d\n",x+y);
printf("b=%8f",b);
} 注:“_”代表一个空格
运行结果为:
7.
#include <stdio.h>
main()
{ int a=1,b=2;
a=a+b;
b=a-b;
a=a-b;
printf(“a=%d,b=%d\n”,a,b);
}
运行结果为:
8.
#include <stdio.h>
main()
{ int x=10;
int y=79;
printf("\n %5d,%5d,%5d ",!x,x||y,x&&y);
}注:“_”代表一个空格
运行结果为:
9.
#include <stdio.h>
main()
{ int z, x=2,y=4;
char w=’c’;
z=x+y;
printf("\n%d,%d,%d,%c",x,y,z,w);
}
运行结果为:
10.
#include <stdio.h>
main()
{char c='a';
printf("%c,%d\n",c,c);
}
运行结果为:
11.
#include <stdio.h>
main ( )
{ char c1, c2;
c1=getchar ( );
printf (“%c, %d\n”, c1,c1 );
c2=c1+32;
printf (“%c,%d\n”, c2,c2 );
}
若敲进A,则运行结果为
13.
#include <stdio.h>
main( )
{ int a=3, b=4;
int z=a+b;
printf(“z=%d\n”,z);
}
运行结果为:
14.
#include <stdio.h>
main()
{int x=6,a=4,y=2,b=6;
x+=x;
printf("x=%d\n",x);
a=y;
printf("a=%d\n",a);
printf("Li is a \'cat\n。");
}
运行结果为:
15.
#include <stdio.h>
main()
{ int i=10,j=10
int x,y,z,w;
x=i--;
y=i;
z=++j;
w=j;
printf("\n%d,%d,%d,%d",x,y,z,w);
}
运行结果为: