Code Monkey home page Code Monkey logo

2016_advanced_c_pointer_0's Introduction

2016_advanced_c_pointer_1

(1-2快班)指针预留作业 2. 【问题描述】编一程序,输入月份号,输出该月的英文月名。例如输入“3”,则输出“March”,要求用指针数组处理。 【输入形式】输入月份号 【输出形式】输出该月的英文月名 【样例输入】3 【样例输出】March 【样例说明】一月:January 二月:February 三月:March 四月:April 五月:May 六月:June 七月:July 八月:August 九月:September 十月:October 十一月:November 十二月:December 3. 【问题描述】输入一个字符串,内有数字和非数字字符,例如: A123x456 17960? 302tab5876 将其中连续的数字作为一个整数,依次输出这些数。 【输入形式】输入一个包含数字的字符串。 【输出形式】输出多个数字,用一个空格分隔。 【样例输入】A123x456 17960? 302tab5 【样例输出】123 456 17960 302 5 4. 【问题描述】写一函数,实现两个字符串的比较,即自己写一个 strcmp 函数,函数原型为 int str_cmp(char *p1, char *p2); 设 p1 指向字符串 s1,p2 指向字符串 s2。要求当 s1=s2时,返回值为 0;若 s1≠s2,返回它们二者第 1 个不同字符的 ASCII 码差值(如“BOY”与"BAD",第2个字母不同,"O"与"A"之差为 79-65=14)。如果 s1>s2,则输出正值;如果 s1<s2,则输出负值。 【输入形式】输入两个字符串。 【输出形式】输出比较结果。 【样例输入】abc abc 【样例输出】0 【样例输入】BOY BAD 【样例输出】14 【样例输入】BAD BOY 【样例输出】-14

2016_advanced_c_pointer_0's People

Contributors

donzoru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.