📄 cube.c
字号:
/* Demonstrates a simple function */
#include <stdio.h>
long cube(long x);
long input, answer;
int main( void )
{
printf("Enter an integer value: ");
scanf("%d", &input);
answer = cube(input);
/* Note: %ld is the conversion specifier for */
/* a long integer */
printf("\nThe cube of %ld is %ld.\n", input, answer);
return 0;
}
/* Function: cube() - Calculates the cubed value of a variable */
long cube(long x)
{
long x_cubed;
x_cubed = x * x * x;
return x_cubed;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -