俄文口譯薪資我想利用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
    文章標籤
    翻譯社
    全站熱搜

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