国语精品91自产拍在线观看二区_色偷偷五月天_天天射夜夜爽_99久久免费国产特黄_1717国产精品久久

一道筆試題目實(shí)習(xí)

時(shí)間:2022-07-03 00:51:28 筆試 我要投稿
  • 相關(guān)推薦

一道筆試題目(實(shí)習(xí))

用C/C++寫一個(gè)函數(shù),它的原形是int continumax(char *outputstr,char *intputstr) 功能:在字符串中找出連續(xù)最長(zhǎng)的數(shù)字串,返回這個(gè)串的長(zhǎng)度,并把這個(gè)最長(zhǎng)的數(shù)字串付給其中一個(gè)函數(shù)參數(shù)outputstr所指內(nèi)存。例如:"abcd12345ed125ss123456789"的首地址傳給inputstr后,函數(shù)將返回9,outputstr所指的值為123456789。

一道筆試題目(實(shí)習(xí))

#include

#include

#include

int continumax(char *outputstr,char *inputstr){

if((outputstr==NULL)||(inputstr==NULL))

return 0;

char *current=inputstr;

char *max_start=NULL;

int len=0,max_len=0,ret_len=0;

while(true)

{

if((*current>=