?? secondh.c
字號:
/* * File: secondh.c * --------------- * This file defines the function SecondHalf(str), * which returns the second half of its argument. */#include <stdio.h>#include "genlib.h"#include "strlib.h"#include "simpio.h"/* Function prototypes */string SecondHalf(string str);/* Main program */main(){ string str; printf("Enter a string: "); str = GetLine(); printf("The second half of \"%s\" is \"%s\"\n", str, SecondHalf(str));}/* * Function: SecondHalf * Usage: newstr = SecondHalf(str); * -------------------------------- * This function returns the second half of the string str. * If the string contains an odd number of characters, the * center character is included in the result. */string SecondHalf(string str){ int len; len = StringLength(str); return (SubString(str, len / 2, len - 1));}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -