#include<>
main()
{
float x=,y=,z=;
printf("x=%f\n",x);
printf("y=%f\n",y);
printf("z=%f\n",z);
}
(1)
#include<>
main()
{
int a=12,b=3;
float x=,y=;
printf("%f\n",(float)(a*b)/2);
printf("%d\n",(int)x%(int)y);
}
(2)
#include<>
main()
{
int x=32,y=81,p,q;
p=x++;
q=--y;
printf("%d %d\n",p,q);
printf("%d %d\n",x,y);
}
#include<>
main()
{
int x,b0,b1,b2,s;
printf("Inputx:");
scanf("%d",&x);
b2=x/100;
b1=(x-b2*100)/10;f\n",p1);
printf("骰子出现 2 的概率:%.2f\n",p2);
printf("骰子出现 3 的概率:%.2f\n",p3);
printf("骰子出现 4 的概率:%.2f\n",p4);
printf("骰子出现 5 的概率:%.2f\n",p5);
printf("骰子出现 6 的概率:%.2f\n",p6);
(1) void Swap(int *x,int *y)
{
int *pTemp;.\n");
else if(strcmp(userInput,password)<0)
printf("Invalid password!user input else printf("Invalid password!user input>password...\n"); return 0; } #include<> #define N 24 unsigned int CountLetter(char str[]); int main() { char a[N]; printf("Input a letter:\n"); gets(a); printf("The length of the letter is:%d\n",CountLetter(a)); return 0; } unsigned int CountLetter(char str[]) { char *p=str; int c=0,flag=0; while(*p!='\0') { if(*p!=' ') flag=1; else if(flag==1) { c++; flag=0; } p++; } return c+1; } #include<> typedef struct data { int year; int month; int day; }DATA; typedef struct work { char a[14]; char b[10]; char c[6]; }WORK; typedef struct student { char studentName[10]; char studentSex; DATA birthday; WORK profession; }STUDENT; int main() { STUDENT stu={"王刚",'M',{1991,5,19},{"信息工程系","学习人员","学生"}}; printf("stu:%2s%3c%6d/%02d/%02d%4s,%4s,%4s\n",,, , 0; } #include<> #include<> #define N 10 typedef struct people { char peopleName[10]; }PEOPLE; int main() { int sum1=0,sum2=0,sum3=0,sum4=0; int i; char name[N][N]; PEOPLE stu[5]={"zhang","li","wang"}; printf("Enter their name:\n"); for(i=0;i<10;i++) { gets(name[i]); if(strcmp(name[i],stu[0].peopleName)==0) sum1++; else if(strcmp(name[i],stu[1].peopleName)==0) sum2++; else if(strcmp(name[i],stu[2].peopleName)==0) sum3++; else sum4++; } printf("stu:%4s%2d\n",stu[i].peopleName,sum[j]); printf("stu:%4s%2d\n",stu[1].peopleName,sum2); printf("stu:%4s%2d\n",stu[2].peopleName,sum3); printf("%2d\n",sum4); return 0; }