Quick actions

cmd+k|ctrl+k

Navigation

Languages

#3

Snippet info

Language

Cpp

Visibility

public

Author

nxnxngh

Created

2018-12-26T10:10:15Z

Updated

2018-12-26T10:10:15Z

#include <iostream>
#include <ctime>
using namespace std;

int main() {
	int q, w, e, r, t, y, result;
	srand(time(NULL));
	q = rand() % 9;
	w = rand() % 9;
	e = rand() % 9;
	r = rand() % 9;
	t = rand() % 9;
	y = rand() % 9;
	result = (q * 100000) + (w*10000) + (e*1000) + (r*100) + (t*10) + y;
	cout << "result = " << result <<endl;
	if (w == 0 && e == 0 && r == 0 || e == 0 && r == 0 && t == 0 || r == 0 && t == 0 && y == 0)
	{
		cout << "This number have three zeros";
	}
	else
	{
		cout << "This number don’t have three zeros";
	}
	return 0;
}
INFO