Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
2478过不了的代码,改用在这题上刚好。#include <stdio.h> int main() { int i, j, n, f[1001] = {0,0}; for(i=2; i<=1000; i++){ f[i] = i*(i-1)/2; for(j=2; j<=i/2; j++) f[i] -= f[i/j]; } scanf("%d", &n); for(i=1; i<=n; i++){ scanf("%d", &j); printf("%d %d %d\n", i, j, f[j]*2+3); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator