Toggle navigation
Courses
Questions
Tags
Users
AC 20161013 作業 2
0
like
0
dislike
10k
views
請設計一個程式,讓使用者輸入兩個正整數a以及b(a <= b),從小到大輸出a到b之間的所有質數。
範例輸入:
1 10
範例輸出:
2 3 5 7
[Exercise]
Coding (C)
-
asked
Oct 13, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 13617 -
Available when:
Unlimited
-
Due to:
Unlimited
|
10k
views
comment
0
0
Called for Help
0
0
Called for Help
0
0
Called for Help
Please
log in
or
register
to add a comment.
91
Answers
0
like
0
dislike
Hidden content!#include <stdio.h>
#include <stdlib.h>
int main(void)
{
* * * * * * * ** * **** ** n,i,s,t;
* ** * * * ***** * ** * ** * * **** * * ** * ** * * * * * ** **
** * * *** * * *** * (s == n;s <= i;s++)
** * * ** ** * *** * *
* * * * ** ** * * * * * * * * * **** * * * * * ** (t=2 ;t < s;t++)
** * * ** * * * * ** * * * * * **
** * * ** * ** * * * ** * * * * * * ** * **** ** == 0)
* ** * * ** * ** ** * * * * * * **** ** *** * * * * ** ** **** **
* *** * ** ** ** * * *** * * * * ** * ** **
* *** * * * * ** ** * ** * ** * * ** * * ** (s == t)
** * ** * * ** * * * ** ** ** *** **** ** * * ** * * * ** * * * * * ("%d ",s);
* * ** * * * ** *
return 0;
}
answered
Oct 13, 2016
by
410523007
(
-157
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!