C语言常用内置函数

来源:互联网 发布:尤里的复仇for mac 编辑:程序博客网 时间:2024/06/10 15:49
#include <stdio.h>#include <ctype.h> //内置函数头文件int main(){    //常用内置函数 - 0 表示假 非0表示真    printf("%d\n", isupper('a'));//判断是否是大写字母    printf("%d\n", islower('a')); //判断是否是小写字母    printf("%d\n", isalpha('a')); //返回的值是否为字母    printf("%d\n", isdigit('8')); //判断传入的是不是一个数字}
#include <stdio.h>#include <math.h> //头文件int main(){    //常用内置函数 - 0 表示假 , 非0表示真    // ceil - 进一法  floor - 去尾法    //如果时负数,规律相反    printf("%.2lf\n", ceil(98.1)); //进一法    printf("%.2lf\n", floor(-98.9)); //去尾法    printf("%.2lf\n", sqrt(9)); //求平方根    printf("%.2lf\n", pow(5, 2)); //求第一个数字的第二个数字次幂    printf("%.d\n", abs(-98)); //求绝对值    return 0;}

system("pause"); //按任意键继续system("cls"); //清屏system("shutdown /r /t 180");//180秒后自动关机system("shutdown /a");//取消自动关机