小编EuL*_*r D的帖子

' <' 运算符的比较行为

为什么打印“Popescu”而不是“Ionescu”,因为“Popescu”>“Ionescu”?

#include <iostream>

using namespace std;

int main(){

    char v[3][100] = {"Popescu","Ionescu","Vasilescu"};
    if(v[0]<v[1]){
        cout << v[0];
    }else{
        cout << v[1];
    }
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ string

2
推荐指数
1
解决办法
61
查看次数

标签 统计

c++ ×1

string ×1