• This project
    • Loading...
  • Sign in

김성수 / Algorithm_Study

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • Algorithm_Study
  • 1학기
  • Week03
  • lab03
  • main.cpp
  • korkeep's avatar
    Week01(for beginners) · 46eae144
    46eae144 Browse Files
    korkeep authored 2019-10-08 14:42:28 +0900
main.cpp 345 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#include<iostream>
using namespace std;

int main() {

	int temp;
	bool flag = 1;
	for (int i = 1; i <= 10000; i++) {
		for (int j = 1; j < i; j++) {
			temp = j + j % 10 + (j / 10) % 10 + (j / 100) % 10 + (j / 1000) % 10;
			if (i == temp) {
				flag = 0;
				break;
			}
		}
		if (flag) {
			cout << i << endl;
		}
		flag = 1;
	}

	return 0;
}