回复 4楼 ldzy
呵呵,不懂二进制数啊
#include <stdio.h> int main() { int power(int x,int y); int x,y; printf("请输入底数与指数分别是:\n"); scanf("%d %d",&x,&y); printf("sum = %d\n",power(x,y)); return 0; } int power(int x,int y) { int sum = 1; int i; for(i = 0;i < y;i++) sum *= x; return sum; }