close

敘利亞語翻譯我想操縱C說話先設一個陣列 然後畫一個原點為(h翻譯社k) 半徑為r的圓 而這圓上面的點為0 其餘為1 .......似乎表達的不是很清楚 抱歉! 像這樣 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 如許比力清晰 圓周上的點為0 其餘為1 #include <stdio.h> #define ROW 24 #define COL 32 #include <math.h> int a[ROW][COL]; void circle(int h,int k,int r){ int x翻譯社y; for(x=h-r;x<=h+r;x++){ y = (float)(sqrt(pow(r,2)-pow(x-h,2)))+k; a[ROW-1-y][x]=0; y = -(float)(sqrt(pow(r,2)-pow(x-h翻譯社2)))+k; a[y][x]=0; } } int main(void) { int x, y ; for(y=0;y<ROW;y++) for(x=0;x<COL;x++) a[y][x]=1 ; circle(10,10,8); for(y=0;y<ROW;y++){ for(x=0;x<COL;x++) printf("%d "翻譯社a[y][x]); printf("; "); } return 0; } 可以請列位幫我看看哪邊的值設錯了嗎? 今朝跑出來的結果差許多 請各位指教 感謝!!

本文出自: https://www.ptt.cc/bbs/C_and_CPP/M.1273128997.A.846.html有關各國語文翻譯公證的問題歡迎諮詢天成翻譯公司02-77260931

arrow
arrow
    文章標籤
    翻譯社
    全站熱搜

    verav3313t0 發表在 痞客邦 留言(0) 人氣()