codeforces_joke_teller's blog

By codeforces_joke_teller, history, 6 weeks ago, In English,

Hello everyone! This is codeforces_joke_teller Code Lesson #1!

Today, I'm going to teach you how to solve a problem — 409H - A + B наносит ответный удар!!!

First, let's look at the description:

Input two integers $$$a,b$$$, output $$$a+b$$$.

Samples:

Input

5 14

Output

19

Hints:

$$$5+14=19$$$

Don't you think it's too easy? Even kindergarten students can solve them???

Yes! It is really very easy! That's why I select them as the first problem of the lesson! Let's take a look at how to write codes.

First, the following template might help:

#include <bits/stdc++.h>
using namespace std;

int main(){
    
    return 0;
}

I won't explain what these lines mean because it won't be easy for beginners to understand. Instead, let's take a look at some commands.

int x;
cin>>x;
cout<<x;

The first line means creating a new variable which is an integer. "int" is short for "integer". The second line means read $$$x$$$ from the program. The third line means print the value of $$$x$$$. Don't forget the ";" at the end of each command.

Don't you think the problem become too easy now? So here's the code:

#include <bits/stdc++.h>
using namespace std;
int a,b;
int main(){
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

This is the end of the lesson. Goodbye for now!

 
 
 
 
  • Vote: I like it
  • -29
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Like father, like son.