/* * 程序的版权和版本声明部分 * Copyright (c)2013,烟台大学计算机学院学生 * All rightsreserved. * 文件名称:array.cpp * 作者:张凯 * 完成日期;: 2013年12月18日 * 版本号: v1.0 * 输入描述: 无 * 问题描述:用数组名作形参计算比较字符串 */ #includeusing namespace std; int astrcmp(const char str1[],const char str2[]); int main() { char str1[50]="hello world."; char str2[50]="good morning!"; cout< j) { return -1;//-1代表str1>str2 } else return 0;//0代表str1 运行结果:
心得体会:保持饥饿
