Chinaunix首页 | 论坛 | 博客
  • 博客访问: 102329
  • 博文数量: 102
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1011
  • 用 户 组: 普通用户
  • 注册时间: 2014-01-15 13:58
个人简介

普普通通一个人

文章分类

全部博文(102)

文章存档

2018年(1)

2015年(13)

2014年(88)

我的朋友

分类: C/C++

2014-02-28 16:17:58


点击(此处)折叠或打开

  1. #include <stdio.h>

  2. int mydraw(int, char);

  3. int main(){
  4.     int side;
  5.     char patten;
  6.     printf("please enter the side and the patten(eg 3 #): ");
  7.     scanf("%d %c", &side, &patten);
  8.     while ((0 != side) && ('0' != patten)){
  9.         mydraw(side, patten);
  10.         printf("please enter the side and the patten(eg 3 #): ");
  11.         scanf("%d %c", &side, &patten);
  12.     }
  13.     return 0;
  14. }

  15. int mydraw(int len, char pen){
  16.     for (int i = 0; i < len; i++){
  17.         for (int i = 0; i < len; i++)
  18.             printf("%c", pen);
  19.         printf("\n");
  20.     }
  21.     return 0;
  22. }

阅读(233) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~