程序代码
#include <stdio.h>#include <stdlib.h>/**csdn学院--2016级*目的:让代码见证成长(作为一个初学的菜鸟,如*大家有发现错误,欢迎指正!)*文件名称:Myfun108.c*作者:小臣小仁*完成日期:2017年2月16日*/void PRintchs(int a,int b){ int i; for(i=1;i<=a;i++) { printf("%c",b); }}int main(){ int j,k=6; int m,n=5; for(j=1;j<=6;j++) { printchs(k-j,' '); printchs(2*j-1,'@'+j); printf("/n"); } for(m=1;m<=k-1;m++) { printchs(m,' '); printchs(2*n-1,'F'+m); n--; printf("/n"); } return 0;}输出结果
知识点总结
提过调用函数来输出菱形,大大减少了程序的冗余
心得体会
作为一个大学二的菜鸟,开始慢慢前进,多多少少感到有收获,由于水平有限,多多少少有错,望包涵
新闻热点
疑难解答