菜鸟觉得这已经碉堡了...

来源:互联网 发布:excel 编程 编辑:程序博客网 时间:2024/05/09 11:09

不解释....不解释....

还有啊,UVA真坑..没有行位的换行符都WA。。

#include<stdio.h>int a[1520];int main(){    int i;    int min;    int temp1,temp2,temp3;    int n,m1,m2,m3;    a[1]=1;    m1=m2=m3=1;    for(i=2;i<=1500;i++)    {        temp1=2*a[m1];        temp2=3*a[m2];        temp3=5*a[m3];        min=temp1;        if(temp2<min)            min=temp2;        if(temp3<min)            min=temp3;        a[i]=min;        if(a[i]==2*a[m1])m1++;        if(a[i]==3*a[m2])m2++;        if(a[i]==5*a[m3])m3++;    }    printf("The 1500'th ugly number is %d.\n",a[1500]);    return 0;}

下次就能想到了~~~!吐舌头某人说的“米西米西~~”hiahia~偷笑

0 0