poj-2101Honey and Milk Land
生活随笔
收集整理的這篇文章主要介紹了
poj-2101Honey and Milk Land
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
題意:就是求對角線的長度
C++過
#include<stdio.h> #include<math.h> int main() {int n,m;while(~scanf("%d%d",&n,&m)){n--,m--;double sum1 = 0,sum2 = 0;double a;while(n--){scanf("%lf",&a);sum1+=a;}while(m--){scanf("%lf",&a);sum2+=a;}double x = sqrt(sum1*sum1+sum2*sum2);int b = x;if(x > b) b++;printf("%d\n",b);} }總結(jié)
以上是生活随笔為你收集整理的poj-2101Honey and Milk Land的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vue-ls vue 本地储存示例
- 下一篇: poj-1064Cable master