Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a;
- cin >> a;
- cout << a;
- return 0;
- }
- */
- // console output
- // console in
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int b, a;
- cin >> a >> b;
- cout << a + b;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int b, a;
- cin >> a >> b;
- cout << a + b << " " << a - b;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- long long a, b;
- cin >> a >> b;
- cout << a * b;
- // int умеет хранить числа до 2^31
- // long long умеет хранить число до 2^63
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- long long a, b;
- cin >> a >> b;
- cout << a * b;
- // int умеет хранить числа до 2^31
- // long long умеет хранить число до 2^63
- return 0;
- }
- */
- // нет возведения в степень
- /*
- #include <iostream>
- using namespace std;
- int main() {
- long long a, b;
- cin >> a >> b;
- cout << a * b;
- // int умеет хранить числа до 2^31
- // long long умеет хранить число до 2^63
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- long long a, b;
- cin >> a >> b;
- cout << a / b;
- // int умеет хранить числа до 2^31
- // long long умеет хранить число до 2^63
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- float a, b;
- cin >> a >> b;
- cout << a / b;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- cout << float(a) / float(b);
- // но при этом написать a = float(a) нельзя, если a - int
- return 0;
- }
- */
- // статическая типизация
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- cout << a % b;
- // но при этом написать a = float(a) нельзя, если a - int
- return 0;
- }
- */
- // если а - отрицательное, остаток тоже отрицательный
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a;
- cin >> a;
- cout << (a % 109 + 109) % 109;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- if (a + b > 5) {
- cout << "x";
- } else {
- cout << "y";
- }
- return 0;
- }
- */
- // в С++ отступы не играют роли
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- if (a + b > 5) {
- cout << "x";
- } else if (a + b == 7 && !(a == 2)) {
- cout << "y";
- }
- return 0;
- }
- */
- // && - and
- // || - or
- // ! - not
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- if (a + b > 5) {
- cout << "x";
- } else if (a + b == 7 && !(a == 2)) {
- cout << "y";
- }
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a;
- cin >> a;
- int res = 0;
- while (a > 0) {
- res += a % 10;
- a /= 10;
- }
- cout << res;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int a, b;
- cin >> a >> b;
- for (int i = a; i <= b; i += 1) {
- cout << i << " ";
- }
- cout << endl;
- for (int i = a; i <= b; i += 2) {
- cout << i << " ";
- }
- return 0;
- }
- */
- // всегда есть три куска
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- for (int i = 0; i < n; i += 1) {
- cout << i << " ";
- }
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int x = 0;
- for (int i = 0; x < n; i += 1) {
- x += i;
- }
- cout << x;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int x = 0;
- for (int i = 0; x < n; i++) {
- x += i;
- // break;
- // continue;
- }
- cout << x;
- return 0;
- }
- */
- /*
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- for (int i = 0; i < n; i++) {
- cout << i << " ";
- i += 3;
- }
- return 0;
- }
- */
Advertisement
Advertisement
Advertisement
RAW Paste Data
Copied
Advertisement