想问一下这2个题的写法
程序代码:
#include <stdio.h> int main(void) { int i, an; long long s; an = 2; s = 0; for (int i = 1; i <=30; ++i) { s = s+an; an = 2*an+3; } printf("%llu\n",s ); return 0; }
程序代码:
#include <stdio.h> int main(void) { int i; long long s,an; an = 3; s = 1; for (int i = 1; i <=10; ++i) { s = s*an; an = an*an+1; } printf("%llu\n",s ); return 0; }