C/C++の宿題を片付けます 88代目
■ このスレッドは過去ログ倉庫に格納されています
0660デフォルトの名無しさん
2007/06/02(土) 13:28:27#include <stdio.h>
int main(void)
{
int i, j;
int LongLength, ShortLength;
int temp;
puts("長方形を作りましょう。");
printf("一辺(その1):"); scanf("%d", &LongLength);
printf("一辺(その2):"); scanf("%d", &ShortLength);
if(ShortLength > LongLength)
{
temp = ShortLength;
ShortLength = LongLength;
LongLength = temp;
}
for(i = 0; i < ShortLength; i++)
{
for(j = 0; j < LongLength; j++) putchar('*');
putchar('\n');
}
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています