From 623403631a90773f57948fc3eda3b60fd78c5df6 Mon Sep 17 00:00:00 2001 From: margaret-k <60312043+margaret-k@users.noreply.github.com> Date: Mon, 25 May 2020 23:35:27 +0300 Subject: [PATCH] Create dz9.1 --- dz9.1 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 dz9.1 diff --git a/dz9.1 b/dz9.1 new file mode 100644 index 0000000..913b7c8 --- /dev/null +++ b/dz9.1 @@ -0,0 +1,33 @@ +#include "pch.h" +#include +using namespace std; +int main() +{ + char str[100]; + cin.get(str, 100); + int b, kolvo=0; + for (int j = 0; str[j] != '\n'; j++) + { + str[j] = b; + if (b == ' ') + kolvo++; //Подсчет количества слов + } + for (int i = 0; i < kolvo; i++) // ???? + { + if (str[i]=' ') + { + //???? + } + int ch = 0; // перевод в десятичную из ASCII + for (int g = 0; g < strlen(str); g++) + { + ch = ch * 10 + (int(str[g]) - int('0')); + } + if (ch % 4 == 0) + cout << "Chislo " << ch << " kratno 4" << endl; + else + cout << "Chislo " << ch << " ne kratno 4" << endl; + } + system("pause"); + return 0; +}