main()
{
int a,b;
char c;
printf(“你的学号”);
scanf(“%d\n”,&a);
printf(“你的年龄”);
scanf(“%d\n”,&b);
printf(“你的名字”);
c=getchar()
printf(“你的学号:%d年龄:%d名字:%c\n”,a,b,putchar(c));
}
帮忙再看下 ~~
有可能你的双引号不是在英文状态下输入的.
好象这样写好一点.
#include <stdio.h>
int main(void)
{
int a,b;
char c[30];
printf("你的学号");
scanf("%d",&a);
printf("\n你的年龄");
scanf("%d",&b);
fflush(stdin);
printf("\n你的名字");
gets(c);
printf("\n你的学号:%d年龄:%d名字:%s\n",a,b,c);
}
好象这样写好一点.
#include <stdio.h>
int main(void)
{
int a,b;
char c[30];
printf("你的学号");
scanf("%d",&a);
printf("\n你的年龄");
scanf("%d",&b);
fflush(stdin);
printf("\n你的名字");
gets(c);
printf("\n你的学号:%d年龄:%d名字:%s\n",a,b,c);
}
很多关键字我还没有学过 呵呵
--------------------Configuration: 30 - Win32 Debug--------------------
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/30.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
30.exe - 2 error(s), 0 warning(s)