1818 - 课后习题1.5

通过次数

0

提交次数

0

时间限制 : 1 秒 内存限制 : 128 MB

请参照本章例题,编写一个C程序,输出以下信息:

**************************

         Very    Good!

数*号可看出,Very前面9空格,Good前面……

*也是输出的一部分,别光打印Very Good!

另注意,星号的行和Very Good的行之间并没有额外的空行。

题目输入

无需输入

题目输出

**************************

         Very    Good!

输入/输出样例

输入格式

no input needed

输出格式

**************************
         Very    Good!
**************************

C语言解答

#include<stdio.h>
int main()
{
  int i=0;
  char s[]="         Very    Good!\n";
  while(i++<26)
    printf("*");
  printf("\n%s",s);
 i=0;
  while(i++<26)
    printf("*");
  printf("\n");
  return 0;
}

C++解答

#include<iostream>
using namespace std;
int main()
{
cout<<"**************************"<<endl;
cout<<"         Very    Good!"<<endl;
cout<<"**************************"<<endl;
}