Submission #146302


Source Code Expand

#include <iostream>
using namespace std;

int main(void) // main関数(プログラムはここから実行される)
{
	int x, y; // int型の変数の宣言
    
    // ------ 値の入力 ------
    // 空白区切りで2つの数字をint型で入力という意味
    // 入力例 12 20
    // x = 12; y = 20
	scanf("%d %d", &x, &y);
    // 入力例 12+30
    //この場合 scanf("%d+%d", &x, &y);
    // C++だとこんな命令もある
    // cin >> x >> y;
    
    
    // ----- 結果の出力 ------
    // xとyを足した結果をint型で出力
    // option + ¥ でバックスラッシュ
	printf("%d\n", x - y);
    
    // C++だとこんな命令もある
    // endlは改行の意味
    // cout << x + y << endl;
    
    return 0;
	
}

Submission Info

Submission Time
Task A - 積雪深差
User shumpeism
Language C++ (G++ 4.6.4)
Score 0
Code Size 802 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:23: error: ‘scanf’ was not declared in this scope
./Main.cpp:22:22: error: ‘printf’ was not declared in this scope