獲取你自己的
網站
×
更改方向
更改主題,深色/淺色
前往 Spaces
#include <stdio.h> int main() { // Create an int and a char variable int myNum; char myChar; // Ask the user to type a number AND a character printf("Type a number AND a character and press enter: \n"); // Get and save the number AND character the user types scanf("%d %c", &myNum, &myChar); // Print the number printf("Your number is: %d\n", myNum); // Print the character printf("Your character is: %c\n", myChar); return 0; }
輸入一個數字和一個字元,然後按回車鍵:5b
您的數字是:5
您的字元是:b