eolymp
bolt
Try our new interface for solving problems
Problems

Divide on three!

published at 3/19/18, 9:13:28 pm

Ознака подільності на 3 - сума цифр ділиться на 3 -_-

published at 3/25/22, 5:51:35 pm

see as string

published at 7/16/22, 10:48:06 pm

Попробовал fgets, почему с такими функциями не работает?

for(int i=0; i<l; i++) summa += m[i] - '0';

published at 4/8/24, 2:45:20 pm

include <iostream>

using namespace std;

int main() { string s; cin >> s; int sum = 0; for (char c : s) { sum += c - 48; } if (sum % 3 == 0) { cout << "YES"; } else { cout << "NO"; } return 0; }