Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define _USE_MATH_DEFINES
- #include <math.h>
- using namespace std;
- /*
- using std::cout;
- using std::cin;
- using std::endl;
- */
- double d = M_PI;
- //void ff;
- //#define cout std::cout
- #define begin {
- #define end }
- #define пока while
- int my_sum_couter = 0;
- int my_sum(int a, int b) {
- /*
- void mult(int c, int d) {
- }
- */
- //int a = 3;
- //int b = 4;
- my_sum_couter++;
- return a + b;
- }
- void print() {
- int x = 0;
- пока(x < 10) begin
- cout << x++;
- end
- cout << endl;
- cout << my_sum << endl;
- cout << my_sum_couter << endl;
- cout << "3 + 4 = " << my_sum(3, 4) << endl;
- cout << "1 + 5 = " << my_sum(1, 5) << endl;
- cout << "4 + 5 = " << my_sum(4, 5) << endl;
- cout << my_sum_couter << endl;
- }
- void draw_rectangle(int w, int h, char ch) {
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++) {
- cout << ch << " ";
- }
- cout << endl;
- }
- }
- int val = 5;
- void task_global() {
- int val = 6;
- //std::endl;
- cout << val << " " << ::val << endl;
- }
- void showinverse(int size, int arr[]) {
- for (int k = size - 1; k >= 0; k--)
- cout << arr[k] << ",";
- cout << endl;
- }
- void showinverse2(int size, int arr[]) {
- for (int k = 0; k < size; k++)
- cout << arr[size - 1 - k] << ",";
- cout << endl;
- }
- void show_tabs() {
- for (int k = 1; k <= 8; k++) {
- for (char ch = 'A'; ch <= 'H'; ch++) {
- cout << ch << k << " ";
- }
- cout << endl;
- }
- }
- void test_showinverse() {
- int arr[]{ 1,2,3,4 };
- showinverse2(size(arr), arr);
- // 4,3,2,1,
- }
- void sum_userinput() {
- static int sum = 0;
- //sum = 0; -
- int a;
- cin >> a;
- sum += a;
- cout << sum << endl;
- }
- void test_cout_atribut() {
- int x = 250;
- cout << x << endl;
- cout << hex << x << dec << endl;
- cout << x << endl;
- cout << dec << x << endl;
- cout << (cout.width(5), x);
- cout << (cout.width(5), x);
- }
- int main() {
- //void rr;
- print();
- draw_rectangle(3, 7, '&');
- task_global();
- cout << val << endl;
- test_showinverse();
- show_tabs();
- //sum_userinput();
- //sum_userinput();
- //sum_userinput();
- test_cout_atribut();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment