注册 登录
编程论坛 C语言论坛

菜鸟求指导。。。主要不知道这个旋转怎么弄

elderdarknes 发布于 2020-03-18 15:31, 1672 次点击
编写一个程序,输入一个线段的长度n(2<n<10),循环输出这个线段围绕其一个端点顺时针旋转90°、180°、270°、360°的动图,按按任意键退出程序。
7 回复
#2
forever742020-03-18 18:35
可以旋实体,也可以旋摄像机。
#3
xianfajushi2020-03-18 20:22
程序代码:

int a=0,j=0;
cin>>a;
while(1)
{
while(j<a)cout<<endl;
j=0;while(j<a)cout<<".";
Sleep(40); system("cls");
j=0;while(j<a)cout<<ends;
j=0;while(j<a)cout<<"."<<endl;
Sleep(40); system("cls");
j=0;while(j<a)cout<<ends;
j=0;while(j<a)cout<<".";
Sleep(40); system("cls");
j=0;while(j<a)cout<<endl;
j=0;while(j<a)cout<<ends;
j=0;while(j<a)cout<<"."<<endl;
Sleep(40); system("cls");
getch();
}

直接写不测试,大概思路,有兴趣的,自己去实现。
只有本站会员才能查看附件,请 登录


[此贴子已经被作者于2020-3-19 14:58编辑过]

#4
elderdarknes2020-03-21 14:12
回复 3楼 xianfajushi
看不懂。。。我们老师提醒我们用数组
#5
xianfajushi2020-03-21 15:17
哦,那么,意思是已经解决了?不妨发出来,比比看。
#6
lin51616782020-03-21 15:42
回复 3楼 xianfajushi
while(j<a)cout<<endl;

毫无疑问 这是一个死循环
这段代码是错的
#7
maomao123452020-03-24 10:34
yesyes
#8
maomao123452020-03-24 17:52
死循环,那么按下任何键结束要如何做呢?
1