实例 C 语言输入两个数字并打印总和

x
 
#include <stdio.h>
int main() {
  // Create a string
  char firstName[30];
  // Ask the user to input some text
  printf("Enter your first name: \n");
  // Get and save the text
  scanf("%s", firstName);
  // Output the text
  printf("Hello %s.", firstName);
  
  return 0;
}
                    

输出结果

Enter your first name and press enter: