#include<stdio.h>
#include<stdlib.h>
int main()
{
int a,b;
scanf("%d
,%d",&a,&b);
// question 1
printf("a=%d , b=%d\n",a,b);
system("pause");
}
想請問一下,假設我scanf理面的兩個%d用逗號隔開顯示出來的a值是我所輸入的數字
但是b值卻出現2293576,(我只能輸入a值,b值它自動顯現出來)
請問這是為什麼,可以幫我解開疑惑嗎???

謝謝!
同上個問題,
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a,b;
scanf("%c
,%c",&a,&b);
//question 2 printf("a=%c \n b=%c",a,b);
system("pause");
}
一樣是用逗號各別隔開%c,但是b值自動顯示出大寫H
WHY???