codeforecs Fox and Number Game

来源:互联网 发布:淘宝收信用卡1%手续费 编辑:程序博客网 时间:2024/04/30 21:08

题目链接:http://codeforces.com/problemset/problem/389/A


非常简单的一题,也非常蛋疼的一题。


#include<stdio.h>int GCD(int a, int b){return b==0? a : GCD(b, a%b);}int main(){int n, x, y, i;scanf("%d%d", &n, &x);for(i=1;i<n;i++)    {scanf("%d", &y);x=GCD(x,y);    }printf("%d", x*n);return 0;}


0 0
原创粉丝点击