Skip to content

Instantly share code, notes, and snippets.

@yukpiz
Created April 13, 2015 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukpiz/6d61be86ab183115e41c to your computer and use it in GitHub Desktop.
Save yukpiz/6d61be86ab183115e41c to your computer and use it in GitHub Desktop.
"number" problem code of paiza.
/*
* [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