菜鸟的简单问题
#include<stdio.h> main() { int this,this1; printf("this: "); scanf("%d ",&this); printf("this1: "); scanf("%d ",&this1); printf("this: %d\n\n\n",this); getch(); } 很简单的一段,但是为什么第一次要输入两次呢??
printf("this: "); scanf("%d",&this); printf("this1: "); scanf("%d",&this1); //注意scanf那句,%d后边不要有空格
楼上正解,不要有空格,否则你还要再输入才能填补。
答:这个问题其实不难,只要对scanf函数的返回值做一个判断并进行处理即可。 下面的代码,请参考: #include "stdio.h" main() { int ...详情>>
问:挺简单的一C函数,不过我是初学者,暂时还不会写,请好心人多多帮忙!
答:int mystrlen(char *str) { int n = 0; while (*str) { n++; str++;} return n; } voi...详情>>