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

包头网站建设优化readme.md做网站

包头网站建设优化,readme.md做网站,网站建设心得500字,网店设计风格有哪些前言 最近需要开始使用python#xff0c;但是对python了解的并不多#xff0c;于是先从很早之前刚学C时写过的一些练手题开始#xff0c;使用python来实现相同的功能#xff0c;在温习python基础语法的同时#xff0c;也一起来感受感受python的魅力 99乘法表 c#xf…前言 最近需要开始使用python但是对python了解的并不多于是先从很早之前刚学C时写过的一些练手题开始使用python来实现相同的功能在温习python基础语法的同时也一起来感受感受python的魅力 99乘法表 c #includeiostream int main() {int i,j;for (i 1; i 9; i){for (j 1; j i; j)std::cout j*i i * j ;std::cout \n;} } python for lie in range(1, 10):for hang in range(1, lie 1):print(f{hang}*{lie}{hang * lie}, end )print() # 打印空行素数 c #includeiostream int judge(int ,bool); int main() {int n;std::cout 请输入数字n判断其是否为素数 \n n;std::cin n;bool flage true;if (judge(n,flage) false) std::cout n不是素数;else if (judge(n,flage) true) std::cout n是素数; } int judge(int n, bool flage) {for (int i 2; i sqrt(n); i){if ((n % i) 0){flage false;break;}}return flage; } python import mathn int(input(请输入数字n判断其是否为素数\nn)) Is_SuShu True for i in range(2, int(math.sqrt(n))):if n % i 0:Is_SuShu Falsebreak if Is_SuShu:print(f{n}是素数) else:print(f{n}不是素数) 水仙花数 c #includeiostream//水仙花数各位数字的立方相加等于其本身 //如果三位数的话就是个位数的立方加上十位数的立方加上百位数的立方等于其本身的数就叫水仙花数 int main()//求100到999内的所有水仙花数 {int i 100;int ge, shi, bai;do {ge i % 10;shi (i % 100) / 10;bai (i % 1000) / 100;if (ge * ge * ge shi * shi * shi bai * bai * bai i)std::cout i \n;i;} while (i 999); return 0; } python for i in range(100, 999):bai_wei int(i / 100 % 10)shi_wei int(i / 10 % 10)ge_wei int(i / 1 % 10)if bai_wei ** 3 shi_wei ** 3 ge_wei ** 3 i:print(i)括号匹配 #includeiostream #includestring #includestack static bool Is_righ(std::string In_str);int main() {std::string In_str;std::cout 请输入一个表达式 ;//如{{([])}}std::cin In_str;if (Is_righ(In_str)) {std::cout 括号匹配;}else {std::cout 括号不匹配;} } static bool Is_righ(std::string In_str) {std::stackchar st;bool check true;for (int i 0; i In_str.length(); i) {switch (In_str[i]) {case (: {st.push((); break;}case [: {st.push([); break;}case {: {st.push({); break;}case ): {if (st.top() ()st.pop();else {check false;break;}break;}case ]: {if (st.top() [)st.pop();else {check false;break;}break;}case }: {if (st.top() {)st.pop();else {check false;break;}break;}default:break;}}if (st.empty() check)return true;elsereturn false; } python st [] In_str input(请输入一个表达式:) # 如{()[]}Is_ok True for i in In_str:if i (:st.append(()elif i [:st.append([)elif i {:st.append({)elif i ):if st[-1] (:st.pop()else:Is_ok Falsebreakelif i ]:if st[-1] [:st.pop()else:Is_ok Falsebreakelif i }:if st[-1] {:st.pop()else:Is_ok Falsebreakif st is None and Is_ok:print(括号匹配, end) else:print(括号不匹配, end)python整体比C要简介的多当然使用python完成C的练习题肯定也不能完全体现python的优势。
http://www.zqtcl.cn/news/794251/

相关文章:

  • 免费网站开发模板云南省网站开发软件
  • dede小游戏php网站源码广州网站vi设计报价
  • 邯郸建设局网站资质申报wordpress 前端 插件
  • 关于asp_sql网站开发的书籍小程序跳转网页方法
  • 昆明网站开发公司电话建设手机银行的网站
  • 福州建设注册中心网站怎么做公司展示网站
  • 网络营销网站建设知识平面设计初中毕业能学吗
  • 2019销售网站开发与设计现状怎么在网上卖东西赚钱
  • 做网站前后端的发布流程如何管理wordpress网站模板下载
  • 网站历史频道怎么做网站修改标题有影响吗
  • 做自己的卡盟网站做技术一般逛那些网站
  • 网站建设自学多长时间做网站原型的软件
  • 营销型的物流网站模板北京楼市最新消息
  • 宁波模版建站公司湘潭建设网站公司
  • 世界十大网站排名出炉最新军事新闻最新消息视频
  • 医疗电子的网站建设城市建设管理
  • win10建站wordpress商城网站结算页面怎么做
  • 电商网站模板引擎惠阳做网站公司
  • 如何在百度做网站推广中企动力企业邮箱手机邮箱
  • extjs做的网站开发公司宣传语
  • 长安做外贸网站关于阅读类网站的建设规划书
  • php网站建设思路方案阿里巴巴如何建设网站
  • 网站做什么推广好网站域名注册步骤
  • 官方建网站有哪些步骤国内成熟的crm系统
  • 建设银行深圳天健世纪支行网站电子商务网站建设员
  • 个人备案域名可以做企业网站吗海南做公司网站
  • 浙江坤宇建设有限公司网站施工企业施工生产计划
  • 成都建站推广域名备案用的网站建设方案
  • 西安市城乡建设管理局网站6一级域名生成二级域名
  • 网站建设沙漠风服装公司网站源码