我想製作一個程序,它以採用用戶輸入的形式, __/__/____
。需要關於以c語言存儲和打印變量的幫助
我做什麼
{
int a, b, c,d,e,f;
printf("Please Enter the *Joining Date* in the format DD/MM/YYYY\n");
scanf_s("%d""%d""%d", &a, &b, &c);
printf("The Date you entered was %d/%d/%d\n", a, b, c);
它所做的是,每次輸入之後,光標移動到新的生產線。請任何幫助,將不勝感激。
它非常不清楚你想要什麼。但是如果你想在一行中輸入,只需在每個數字而不是數字之後按空格。 – ameyCU
嘗試類似:scanf(「%d /%d /%d」,&a,&b,&c); – Mimouni
'scanf_s(「%02d /%02d /%04d」,&a,&b,&c);' –