Áß 1 ¼öÇн𣿡 Çб³¿¡¼ ¼Ò¼ö¸¦ ¹è¿ì´Âµ¥,
¹è¿ì´Â µµÁß ¹®µæ c¾ð¾î Äڵ尡 »ý°¢³ª¼ Áý¿¡¿Í¼ Çѹø ¸¸µé¾î º¸¾Ò½À´Ï´Ù.
ÀÏ´Ü ¼Ò½º¸¦ º¸½ÃÁÒ.
Colored By Color Scripter¢â
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
void main()
{
unsigned long long i, j, count = 1, s_max;
long sum = 0;
FILE *out;
out = fopen("a.txt", "w");
printf("¾îµð±îÁöÀÇ ¼Ò¼ö¸¦ Ãâ·ÂÇϽðٽÀ´Ï±î?");
scanf("%lld", &s_max);
for(i=1;i<=s_max;i++){
for(j=2;j<i;j++){
if((i%j)==0)
break;
}
if(i==j){
fprintf(out, "%lld\t", i);
printf("%lld\t", i);
count++;
if((count%8)==0)
fprintf(out, "\n");
printf("\n");
}
}
fprintf(out, "\n1ºÎÅÍ %lld ±îÁöÀÇ ¼Ò¼ö´Â %lld°³ ÀÔ´Ï´Ù.", s_max, count);
printf("\n1ºÎÅÍ %lld ±îÁöÀÇ ¼Ò¼ö´Â %lld°³ ÀÔ´Ï´Ù.", s_max, count);
fclose(out);
}
¸ðµç ¼ýÀÚ¸¦ µ¥ÀÔÇؼ ¼Ò¼ö¸¦ ã´Â Çü½ÄÀ¸·Î ÇÑ °á°ú
¿ª½Ã ¼º°øÀûÀÌ¿´½À´Ï´Ù!!
ÇÏÁö¸¸ ´õ Å« ¼ýÀÚ¸¦ ÇÏ°Ô µÇ¸é
ÀÌ¿Í °°ÀÌ ¸Å¿ì ´À¸° ¼Óµµ·Î ¿¬»êÀ» ÇÏ°Ô µË´Ï´Ù.
±×·¡¼!!
´Ù½Ã ¸¸µé°Ô µÇ¾ú½À´Ï´Ù.
Colored By Color Scripter¢â
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<stdio.h>
int main()
{
FILE *out;
out = fopen("a.txt", "w");
unsigned int n, x, y, count=0;
printf("¾îµð±îÁöÀÇ ¼Ò¼ö¸¦ Ãâ·ÂÇϽðٽÀ´Ï±î?");
scanf("%d", &n);
x=1;
if(n>0){
fprintf(out, "2\t");
printf("2\t");
count++;
while(x+2<n) {
x+=2;
y=3;
while(y*y<x && x%y!=0){
y+=2;
}
if(y*y>x) {
fprintf(out, "%d\t", x);
printf("%d\t", x);
count++;
if((count%8)==0){
fprintf(out, "\n");
printf("\n");
}
}
}
fprintf(out, "\n1ºÎÅÍ %d ±îÁöÀÇ ¼Ò¼ö´Â %d°³ ÀÔ´Ï´Ù.", n, count);
return 0;
}
}
ÀÌ ¹æ¹ýÀº 2¸¦ Á¦¿ÜÇÑ È¦¼öµé¸¸ ã´Â Çü½ÄÀÔ´Ï´Ù.
°ú¿¬ ÀÌ ¹æ¹ýÀº È¿°ú°¡ ÀÖÀ»±î¿ä??
¿ª½Ã È®¿¬ÇÑ Â÷À̸¦ º¸À̳׿ä
ÀÌ»óÀÔ´Ï´Ù^^
±×¸²&µ¿¿µ»óÀ» º¸½Ã·Á¸é http://blog.naver.com/0226daniel/220035729531 |