Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++·s¤â°Ý

0 views
Skip to first unread message

現在.....(b)

unread,
Apr 7, 2002, 10:16:26 PM4/7/02
to
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int i=0;
for (i=0;i<=255;i++)
printf("%d %c",i,i);
}
請問要如何將結果修改為
一行顯示5個
--
Origin: 台東高商 bbs.tscvs.ttct.edu.tw (203.71.3.3)

JEN

unread,
Apr 8, 2002, 12:09:15 PM4/8/02
to

#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int i,j;

for (i=0;i<=255;i++)
{ if ((i+1)%5)
printf("%d%c ",i,i);
else
printf("\n");
}
getch();

} //turbo c 3.0

--
※ [36;1m風信遊子 [35m(bbs.cm.nctu.edu.tw) [37m ★ [33mPost From: [34m jenallen.Dorm9.NCTU.edu.tw [m★

0 new messages