?? ex22.c
字號(hào):
#include <stdio.h>
main() { /* 主函數(shù)體 */
int x, n, p, power(int x, int n);
printf("caculate X to the power of N\n please input X and N ? ");
scanf("%d%d",&x,&n);
p = power(x,n); /* 在此處調(diào)用函數(shù) */
printf("%d to the power of %d = %d\n",x,n,p);
while(1);
}
int power(int x,int n) /* 被調(diào)用函數(shù) */
int x, n;
{
int i, p = 1;
for( i=0; i<n; ++i ) p *= x;
return( p ); /* 帶值返回到調(diào)用處 */
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -