// ConsoleApplication5.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <iostream> #include<cstdio> #include<algorithm> #include<cstdbool> #include<cmath> #include<string> #include<cstring> using namespace std; //好学生不要学 int main() { int yes[16] = { 11,101,131,151,181,191,313,353,373,383,727,757,787,797,919,929 }; int z, zz; cin >> z >> zz; int www = 1; for (int i = 0; i < 16; i++) { if (yes[i] >= z && yes[i] <= zz) { if(www%5!=0){ printf("%6d", yes[i]); www++; } else { printf("%6d\n", yes[i]); www++; } } } return 0; } |
Double click to view unformatted code.