1. 用命令行參數實現。求命令行參數中長度最大的字元串。
#include<stdio.h>#include<string.h>char * compare(char a[], char b[]){ return strlen(a)>strlen(b)? a:b;}main(){ char a[] = "aaaaaa\0"; char b[] = "bbbbb\0"; printf("%s\n", compare(a,b));}