zoukankan      html  css  js  c++  java
  • C语言常用函数-ispunct()判断字符是否为标点符号函数

    演示版本

    VS2013

    • ispunct()函数

    ispunct()函数用于判断字符是否为标点符号。

    语法

    int ispunct(int ch);

    ispunct()函数的语法参数说明如下:

    参数ch为一个待检查的字符。

    ispunct()函数的返回值:不是标点符号返回0,是则返回非0。

    示例

    #include <stdio.h>
    #include <ctype.h>
    
    int main()
    {
        char ch;
        printf("input a character");//输入一个字符
        scanf_s("%c", &ch);
        if (ispunct(ch))//判断输入的字符是否为标点符号
            printf("%c is putct
    ", ch);
        else
            printf("%c is not punct", ch);
    
    
        return 0;
    }

    阿飞

    2021年7月27日

  • 相关阅读:
    20171121
    20171117
    20171106
    20171031
    20171024
    20170924
    20170721
    商品的分类
    会员价格的修改
    会员价格删除
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/15067864.html
Copyright © 2011-2022 走看看