if eles 问题
来源:互联网 发布:扫地机器人算法 编辑:程序博客网 时间:2024/06/06 07:37
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
const int Size = 15;
char n1[Size];
char n2[Size]="C++owboy";
char n3[] = "lson";
cout << "Howdy! IM" << n2 << "! your name?\n";
cin >> n1;
if (n1 == n3)
cout << "well, " << n1 << "I konw you\n";
else
{
cout << "well, " << n1 << " your name has" << strlen(n1) << " letters and is stored\n";
cout << "in a array of " << sizeof(n1) << "bytes.\n";
cout << "your is " << n1[0] << endl;
n2[3] = 0;
cout << "my name: " << n2 << endl;
}
return 0;
#include<cstring>
using namespace std;
int main()
{
const int Size = 15;
char n1[Size];
char n2[Size]="C++owboy";
char n3[] = "lson";
cout << "Howdy! IM" << n2 << "! your name?\n";
cin >> n1;
if (n1 == n3)
cout << "well, " << n1 << "I konw you\n";
else
{
cout << "well, " << n1 << " your name has" << strlen(n1) << " letters and is stored\n";
cout << "in a array of " << sizeof(n1) << "bytes.\n";
cout << "your is " << n1[0] << endl;
n2[3] = 0;
cout << "my name: " << n2 << endl;
}
return 0;
}
奇怪的是我输入lson,却是显示的为else的内容,现在没有看到if那章,但不应该,留着以后看看
0 0
- if eles 问题
- if...else中的问题
- Mybatis IF判断问题
- if...else...问题
- if-else优化问题
- if 和 else if 的效率问题
- Java if 和 if else 问题
- if else if的判断问题
- #if和#ifdef使用问题
- 关于if的小问题
- Excel if函数颜色问题
- Mybaitis if标签转义问题
- if语句的嵌套问题
- php if语句的问题
- 关于if语句的问题
- Java中的IF语句问题
- 对于if ...else if .... 分支太多的问题
- <s:if></s:if>标签判断空字符串问题
- 插入排序二分排序冒泡排序
- Sicily 1530. The Seven Percent Solution
- 设计模式-桥接模式
- Git基本常用命令
- File and Print Services for Microsoft® Windows® Clients (Samba)
- if eles 问题
- 遍历map效率最高的方法
- 添加xib 子控件约束
- 个人总结3
- 004Median of Two Sorted Arrays (C)
- Git 解决Bug:fatal: Could not read from remote repository ——诺诺"涂鸦"记忆
- 设计模式-组合模式
- 3.大神班 scrollView 与 动画 imageView的加载图片
- iOS强弱引用宏