当前位置: 首页 > news >正文

hello判断

描述

从键盘输入由5个字符组成的单词,判断此单词是不是hello,并显示结果。

输入

由5个字符组成的单词

输出

输出一句话: "this word is not hello!" 或者 "this word is hello!"。

输入样例 1

hello

输出样例 1

this word is hello!

输入样例 2

lello

输出样例 2

this word is not hello!

python3

word = input().strip()
if word == "hello":print("this word is hello!")
else:print("this word is not hello!")    

c++

#include <iostream>
#include <string>
#include <algorithm>int main() {std::string word;std::cin >> word;// 移除首尾空白字符(如果需要)// word.erase(0, word.find_first_not_of(" \t"));// word.erase(word.find_last_not_of(" \t") + 1);if (word == "hello") {std::cout << "this word is hello!" << std::endl;} else {std::cout << "this word is not hello!" << std::endl;}return 0;
}

http://www.dtcms.com/a/267019.html

相关文章:

  • 斜线投影几何分割公式 h = rx·ry/(rx+ry) 的推导方法
  • 【github】想fork的项目变为私有副本
  • boost--io_service/io_context
  • FFmpeg 升级指北
  • 【网络与系统安全】强制访问控制——Biba模型
  • AI生成式软件工程正处在从“辅助编程”到“AI原生开发”的范式转移
  • 使用坚果云扩容Zotero同步空间的简单快捷方法
  • Vue3-组件化-Vue核心思想之一
  • Python 中的余数运算及数论中的同余定理
  • 五层协议介绍
  • 指针篇(7)- 指针运算笔试题(阿里巴巴)
  • CSS——圆形头像外嵌光圈
  • springsecurity02
  • js中的FileReader对象
  • ESP32CAM通过ESPHome接入HomeAssistant(含无线刷固件等)
  • Python-GUI-wxPython-控件
  • 语音大模型速览(一)F5-TTS
  • 《汇编语言:基于X86处理器》第6章 复习题和练习,编程练习
  • Selenium 安装使用教程
  • Python 量化交易安装使用教程
  • 深度学习3(向量化编程+ python中实现逻辑回归)
  • 遗传算法的原理与实现示例
  • XION:玩转您的第一个智能合约
  • Seq2seq+Attention 机器翻译
  • Go中使用国家新闻出版署实名认证
  • [C++] # 深入理解C++继承:从原理到实现
  • 通过网页调用身份证阅读器http websocket方法-华视电子————仙盟创梦IDE
  • 结构型智能科技的关键可行性——信息型智能向结构型智能的转换(提纲)
  • CSS知识复习2
  • 3-1 PID算法改进(积分部分)