赞
踩
- #include<stdio.h>
- #include<string.h>
- #include<iostream>
- #include<time.h>
- using namespace std;
- int chose(int s)
- {
- int i = 2;
- do {
- if (s % i == 0 && s != i || s == 1)
- return 0;
- i++;
- } while (i < s);
- return 1;
- }
- int main()
- {
- int a[10], b, c;
- for (int i = 0; i < 10; i++)
- scanf_s("%d", &a[i]);
- for (int i = 0; i < 10; i++)
- {
- c = chose(a[i]);
- if (c == 1)printf("%-5d", a[i]);
- }
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。