输入结束了,不知道什么原因无输出结果,再任意进行一次输入才出结果
#include
int main(){
int A,B,C;
scanf("%d %d\n",&A,&B);
C=A*B;
printf("%d\n",C);
return 0;
}
想要输入两个数,直接产生结果
scanf里面的\n去掉,不然他需要读到回车
scanf("%d %d\n",&A,&B);里\n去掉
scanf语句中的\n删除掉!!!
记住,scanf和printf不一样,不需要增加除了%d这种格式符之外的任何字符。只要在scanf中输入了其它字符,那么你在输入的时候就一定也要在同样的位置输入相同的字符才可以!!!
去掉第四行的\n
输入格式中的空白符是用来忽略输入流的中空白符,因此你的输入格式中\n会一直等待你输入直到遇到非空白符位置
https://en.cppreference.com/w/c/io/fscanf
whitespace characters: any single whitespace character in the format string consumes all available consecutive whitespace characters from the input (determined as if by calling isspace in a loop). Note that there is no difference between "\n", " ", "\t\t", or other whitespace in the format string.