0 1
Learner (05.24.2011 12:50 PM)
[ Entry]
Aguu toonii talaar yariltsay tegeh uu... Bi 1 function zohioson chini 1 l boldoggui. haraad ogooch. zambraagui bichsen bolhoor oilgooroi hehe #include <iostream> #include <string> using namespace std;
struct X{ public: static void DisplayBigNumbers(int startN,int endN){ int bigNumberCount = 0; int count=0; string str=""; for(int i=startN; i<=endN; i++){ int j=0; bool isBigNumer = true; str=i+""; while(isBigNumer && j<str.size()){ int digit = (int)str[j]; if( digit != 0 && i % digit != 0){ isBigNumer = false; } j++; } if(isBigNumer){ bigNumberCount++; } } cout<<bigNumberCount<<endl; } }; int main() { int firstInput,secondInput; int lineCount; cin>>lineCount; for(int i=0; i<lineCount; i++){ cin >> firstInput>>secondInput; X::DisplayBigNumbers(firstInput, secondInput); }
system("pause");
}
|