サイトのタイトルを書きます。

サブタイトルを書きます。

C++入門 AtCoder Programming Guide for beginners (APG4b)

A - Bichrome Cells

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { // 一年の秒数 int N,A; cin >> N >> A; cout << N*N-A << endl; } atcoder.jp</bits/stdc++.h>

A - Rating Goal

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { int a,b; cin >> a >> b; cout << 2*b-a << endl; } ■備考 A=今回求める数 (a+A)/2 = b A=2b-aatcoder.jp</bits/stdc++.h>

A - New Year

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { int Time; cin >> Time; int RemainTime = 24+24-Time; cout << RemainTime << endl; } atcoder.jp</bits/stdc++.h>

EX4 - ◯年は何秒?

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { // 一年の秒数 int seconds = 365 * 24 * 60 * 60; // 以下のコメント/* */を消して追記する cout << seconds << endl; cout << 2*seconds << endl; cout << 5*seconds << endl; cout << 10*seconds <</bits/stdc++.h>…

EX3 - 計算問題

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { cout << 100/2*(100+1) << endl; } ■注意点 C++では、1/2=0 2/2=1 3/2=1 小数点以下は出力されない。 atcoder.jp</bits/stdc++.h>

EX2 - エラーの修正

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { cout << "いつも" << "2525" << endl; cout << "AtCoderくん" << endl; } atcoder.jp</bits/stdc++.h>

EX1 - コードテストと出力の練習

■回答C++ #include <bits/stdc++.h> using namespace std; int main() { cout << "こんにちは" << endl; cout << "AtCoder" << endl; } atcoder.jp</bits/stdc++.h>