#include<iostream> #include<math.h> #define Pi 3.1415926 using namespace std; int main(){ int i,sinx,cosx; int line=0;//行数 float x=0; for(;line<25;x+=Pi/12,line++){ //行间循环 sinx=39+int(38*sin(x)); cosx=39+int(38*cos(x)); for(i=0;i<80;i++){ //行内循环 if(i == sinx ) cout<<‘s‘; //优先输出sinx else if(i == cosx) cout<<‘c‘; //其次输出cosx else if(i == 39) cout<<‘|‘; //最后y轴 else cout<<‘ ‘; //其余空格 } //end of 行内 cout<<endl; //换行 } //end of 行间 return 0; }
原文地址:https://www.cnblogs.com/OKDA/p/12495013.html
时间: 2024-10-08 04:54:51