#include<stdio.h> int main(){ int n ; printf("n="); scanf_s("%lld", &n); int sum = 0, i = 0, t = 1; while (i <= n) { sum += t; t *= 2; i++; } printf("sum=%lld\n", sum); }
标签:task3,int,scanf,while,printf,main From: https://www.cnblogs.com/liangchenxi/p/16793885.html