本文介绍了asterick作业问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我找不到合适的源代码: 输出应该是: 问题编号1)。 输入星号数:5 * ** *** * *** ***** 再试一次?[是/否]:__ ---- -------------------------------------------------- - 问题编号2)。 输入星号数:5 ***** * *** *** ** * 再试一次?[是/否]: __ i couldn''t find out the right source code for this one:output should be: problem number 1).enter number of asterisks:5***************try again?[Y/N]: __ -------------------------------------------------------problem number 2).enter number of asterisks:5***************try again?[Y/N]: __推荐答案 我只编码了这个: #include< stdio.h> #include< ; conio.h> void main(无效) { int x,y; char choice ; do { clrscr(); printf("输入星号:"); scanf("%i"& y); for(x = 1; x< = y; x ++) { gotoxy(x * 1,x * 1 + 2); cprintf(" *"); } printf(" \ ntry再次[是/否]:"); choice = getch(); } while(choice ==''Y''|| choice =='' y''); getch(); } ,输出为: * * * 所需输出为: 输入星号: 3 * ** *** 再试一次[y / n]:__ ,另一个是这样的: 输入星号数: 3 *** ** * 再试一次[是/否]:__ $ b $你可以帮帮我吗...我知道你可以 i只剩下一点时间; 明天会提交...... 非常感谢!!! I just encoded this: #include<stdio.h>#include<conio.h>void main (void){int x,y;char choice;do{clrscr();printf("Enter number of asterisk:");scanf("%i",&y);for(x=1;x<=y;x++){gotoxy(x*1,x*1+2);cprintf("*");}printf("\ntry again [Y/N]:");choice=getch();}while(choice==''Y'' || choice==''y'');getch();} and the output is:* * * the output required is: Enter number of asterisks: 3******try again [y/n]: __ and the other one goes like this:Enter number of asterisks: 3******try again [y/n]: __ can you help me pls..i know you can i just got a little time left;submission will be tomorrow...thanks alot!!! 这篇关于asterick作业问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-16 11:37