【C++正整数】
inline int in()//快速读入
{
int ch,ans;
ch = getchar();
if (-1 == ch) return -1;//读取EOF
while(ch < '0' || '9' < ch) ch = getchar();
ans = ch-'0';
while((ch = getchar()) >= '0' && '9' >= ch) ans = (ans<<3)+(ans<<1)+ch-'0';
return ans;
}
【C++正负整数】
inline int in()
{
int f = 1, ans, ch;
while((ch = getchar()) < '0' || ch > '9') if('-' == ch) {ch = getchar(),f = -1; break;}
ans = ch-'0';
while((ch = getchar()) >= '0' && ch <= '9') ans = (ans<<3)+(ans<<1)+ch-'0';
return f*ans;
}
【JAVA输入hdu5047】
import java.math.BigInteger;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.FileWriter;
class Main {
static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
public static void main(String []args) throws Exception{
int TC = Integer.parseInt(in.readLine());
int T = 0;
while (TC-- > 0) {
T++;
out.write("Case #" + T + ": ");
BigInteger N = new BigInteger(in.readLine());
BigInteger e = BigInteger.valueOf(8);
BigInteger s = BigInteger.valueOf(7);
BigInteger rlt = N.multiply(N).multiply(e).subtract(N.multiply(s)).add(BigInteger.ONE);
out.write(rlt.toString());
out.newLine();
}
out.flush();
}
}