输出国际象棋输出余弦曲线
生活随笔
收集整理的這篇文章主要介紹了
输出国际象棋输出余弦曲线
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
輸出國際象棋棋盤
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <windows.h> 4 int main(){ 5 int i,j; 6 SetConsoleOutputCP(437);//顯示大于127的ASiic 碼 7 for(i=0;i<8;i++){ 8 for(j=0;j<8;j++){ 9 if((i+j)%2==0 ){ 10 printf("%c%c",219,219); //219號碼代表國際象棋棋盤上的方塊標 11 } 12 else{ 13 printf(" "); 14 } 15 } 16 printf("\n"); 17 } 18 system("pause"); 19 return 0; 20 } 21 22 23?
輸出余弦曲線
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 5 int main(){ 6 double y; 7 int x,m; 8 for(y=1;y>=-1;y-=0.1){ 9 m=(int)(acos(y)*10); 10 for(x=0;x<m;x++) printf(" "); 11 printf("*"); 12 for(;x<62-m;x++) printf(" "); 13 printf("*\n"); 14 } 15 system("pause"); 16 return 0; 17 }?
轉載于:https://www.cnblogs.com/liugl7/p/4820315.html
總結
以上是生活随笔為你收集整理的输出国际象棋输出余弦曲线的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于XMPP实现的Openfire的配置
- 下一篇: 如何准备考试