zoukankan      html  css  js  c++  java
  • 2.求一个整数有几位(简单字符串操作)


     

     时间限制: 1 s
     空间限制: 1000 KB
    题目描述 Description

    求一个整数有几

    第一行输入一个整数(int)N(如2563)

    第二行输出该整数N是个几位数(4).

     

     

    输入描述 Input Description

    第一行是个整数,例如2563

    输出描述 Output Description

    第二行,如4

    样例输入 Sample Input

    34532

    样例输出 Sample Output

    5

    数据范围及提示 Data Size & Hint

    求一个整数有几

    第一行输入一个整数(int)N(如2563)

    第二行输出该整数N是个几位数(4).

    源代码如下:

    #include

    using namespace std;

    #include

    #include

    int main()

    {

    char s[101];

    gets(s);

    cout<<strlen(s)<<endl;

    return 0;

    }

  • 相关阅读:
    学习自建调试体系(二)
    寻找未导出函数的函数地址
    Http
    git忽略.gitignore
    Flask-sqlacodegen
    liunx速查
    BBS论坛项目
    vim操作
    部署
    python3 环境搭建
  • 原文地址:https://www.cnblogs.com/csgc0131123/p/5290602.html
Copyright © 2011-2022 走看看