Created
April 13, 2015 11:33
-
-
Save yukpiz/6d61be86ab183115e41c to your computer and use it in GitHub Desktop.
"number" problem code of paiza.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* [Compile] | |
* g++ -std=c++11 number.cpp -o number | |
*/ | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int main( | |
int arg, | |
char **args) | |
{ | |
int num; | |
cin >> num; | |
int count; | |
cin >> count; | |
vector<int> rooms; | |
for (int i = 0; i < count; i++) { | |
int room; | |
cin >> room; | |
rooms.push_back(room); | |
} | |
bool findflg = false; | |
for (int i = 0; i < rooms.size(); i++) { | |
string room = to_string(rooms[i]); | |
if (room.find(to_string(num), 0) == string::npos) { | |
cout << room << endl; | |
findflg = true; | |
} | |
} | |
if (!findflg) { | |
cout << "none" << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment