/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include #include #include using namespace std; int main() { int x; float p,p2,p3,p4; p = 1; p2 = 0; p3 = 0; p4 = 0; cin >> x; while (x!=0) { p++; if (x % 2 == 0) {p2++;} if (x % 3 == 0) {p3++;} if (x % 4 == 0) {p4++;} cin >> x; } cout << "zadali jste celkem " << p << " cisel"; cout << "delitelne 2 : " << fixed << setprecision(2) << 100*p2/p << " %"; cout << " delitelne 3 : " << fixed << setprecision(2) << 100*p3/p << " %"; cout << " delitelne 4 : " << fixed << setprecision(2) << 100*p4/p << " %"; }