菜鸟求指导。。。主要不知道这个旋转怎么弄
编写一个程序,输入一个线段的长度n(2<n<10),循环输出这个线段围绕其一个端点顺时针旋转90°、180°、270°、360°的动图,按按任意键退出程序。
程序代码:
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编辑过]