HDU 1021:
饿。。打表。。算出每项%3的结果即可
#import <stdio.h>
int a[1000001];
int main() {
int input;
a[0] = 7%3;
a[1] = 11%3;
for (int i=2; i<=1000000; ++i)
a[i] = (a[i-1] + a[i-2])%3;
while (~scanf("%d",&input))
if(!a[input]) printf("yes\n");
else printf("no\n");
}
HDU 1002:
利用JAVA 水高精度 = =
import java.util.Scanner;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) {
int ncase;
BigInteger a,b,c;
Scanner input = new Scanner(System.in);
ncase = input.nextInt();
for (int i=0; i<ncase; ++i) {
a = input.nextBigInteger();
b = input.nextBigInteger();
c = a.add(b);
System.out.printf("Case %d:\n\r",i+1);
System.out.println(a+" + "+b+" = "+c);
if(i!=ncase-1) System.out.println("");
}
}
}