一、N-S流程图;
二、运行结果;
三、源代码;
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>int main()
{//初始化变量值;int i, result;char s1[100], s2[100];//填充数组;printf("请输入数组s1的内容:");gets(s1);printf("请输入数组s2的内容:");gets(s2);//赋值;i = 0;//跳过相同的字符;while ((s1[i] == s2[i]) && (s1[i] != '\0')){//改变变量值;i++;}//比较;if ((s1[1] == '\0') && (s2[i] == '\0')){//赋值;result = 0;}else{//运算;result = s1[i] - s2[i];}//输出;printf("%d", result);return 0;
}