logo
Автор: Riateche
Описание: for miang
Язык: C++
#include <iostream>
using namespace std;

bool good_number(int n) {
	int m = n;
	while (m) {
		int c = m - (m/10)*10; //вычисляем последнюю цифру
		if (!c || n % c) return false; // цифра=0 или остаток>0
		m /= 10; //удаляем последнюю цифру
	}
	return true;
}

int main(int argc, char** argv) {
	int i, n;
	cout << 21 % 2;
	n = 1000;
	for (i = 1; i <= n; i++) {
		if (good_number(i)) cout << i << endl;
	}
	return 0;
}
Последние размещения:
blessmaster (PHP)
antonivanov (SQL)
antonivanov (PHP)
brinza (PHP)
ilyhamas (Delphi)
Riateche (PHP)
otherlight (Java)
otherlight (JavaScript)
otherlight (CSS)
otherlight (CSS)
biophreak (JavaScript)
n4n (Perl)
prostoHz (Java)
ndubinkin (XML)
Riateche (Plain Text)
Slapotam (Perl)
ksurent (Perl)
John_Wein (Java)
John_Wein (HTML)
Riateche (HTML)
netsago.paste.β © 2009 Neunica