Problem I: scanf/printf输入输出

Problem I: scanf/printf输入输出

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

输入一个整数:输出它的2倍。使用scanf/printf输入输出。

解法

  • 引入头文件 #include <cstdio>,定义1个变量a
  • 用scanf 读入一个数字,存进a变量中。
  • 用printf 输出计算结果。注意双引号内的占位符。
#include <_____>
using namespace std;
int main() {
    int a; // 定义变量 a
    scanf(____, ____); // 接受一个整数的读入,放入变量 a 中
    printf(____, ____); // 计算 a*2,然后作为整数输出
    return 0;
}

Sample Input Copy

3

Sample Output Copy

6