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

北京建设教育协会网站首页网络营销的重要性与意义

北京建设教育协会网站首页,网络营销的重要性与意义,建app网站要多少钱,百度seo文章(一)概述 (Ⅰ)彩票是幸运的 (Ⅱ)AI 英文问答程序 ( Ⅲ ) 胎压检测 (二)题目 Ⅰ 彩票的号码有 6 位数字,若一张彩票的前 3 位上的数之和等于后 3 …

    (一)概述

          (Ⅰ)彩票是幸运的

         (Ⅱ)AI 英文问答程序

        ( Ⅲ ) 胎压检测

(二)题目

   

    Ⅰ  彩票的号码有 6 位数字,若一张彩票的前 3 位上的数之和等于后 3 位上的数之和,则称这张彩票是幸运的。本题就请你判断给定的彩票是不是幸运的。

输入格式:

输入在第一行中给出一个正整数 N(≤ 100)。随后 N 行,每行给出一张彩票的 6 位数字。

输出格式:

对每张彩票,如果它是幸运的,就在一行中输出 You are lucky!;否则输出 Wish you good luck.

输入样例:

2

233008

123456

输出样例: 

You are lucky!
Wish you good luck.

题目分析: 怎么去表达彩票号码呢?怎么去存储每一次对彩票的幸运的鉴定呢?怎么样去输出呢?

思路:用字符串存储彩票,用数组来存储对对彩票的幸运的鉴定,用条件语句输出。

具体代码:

#include <stdio.h>
#include <string.h>int main()
{char a[10] = { 0 };int b[100] = { 0 }, n = -1;scanf("%d", &n);for (int i = 0; i < n; i++) {scanf("%s", a);
//因为彩票长度固定if ((a[0] + a[1] + a[2]) == (a[3] + a[4] + a[5])){b[i] = 1;}}for (int i = 0; i < n; i++){printf("%s", (b[i] == 1) ? "You are lucky!\n" : "Wish you good luck.\n");}return 0;
}

Ⅱ    AI 英文问答程序

本题要求你实现一个稍微更值钱一点的 AI 英文问答程序,规则是:

  • 无论用户说什么,首先把对方说的话在一行中原样打印出来;
  • 消除原文中多余空格:把相邻单词间的多个空格换成 1 个空格,把行首尾的空格全部删掉,把标点符号前面的空格删掉;
  • 把原文中所有大写英文字母变成小写,除了 I
  • 把原文中所有独立的 can youcould you 对应地换成 I canI could—— 这里“独立”是指被空格或标点符号分隔开的单词;
  • 把原文中所有独立的 I 和 me 换成 you
  • 把原文中所有的问号 ? 换成惊叹号 !
  • 在一行中输出替换后的句子作为 AI 的回答。

输入格式: 

输入首先在第一行给出不超过 10 的正整数 N,随后 N 行,每行给出一句不超过 1000 个字符的、以回车结尾的用户的对话,对话为非空字符串,仅包括字母、数字、空格、可见的半角标点符号。

输出格式: 

按题面要求输出,每个 AI 的回答前要加上 AI: 和一个空格。

输入样例:

6
Hello ?Good to chat   with you
can   you speak Chinese?
Really?
Could you show me 5
What Is this prime? I,don 't know

输出样例:

Hello ?
AI: hello!Good to chat   with you
AI: good to chat with you
can   you speak Chinese?
AI: I can speak chinese!
Really?
AI: really!
Could you show me 5
AI: I could show you 5
What Is this prime? I,don 't know
AI: what Is this prime! you,don't know

代码实现:

 Ⅲ  胎压检测

小轿车中有一个系统随时监测四个车轮的胎压,如果四轮胎压不是很平衡,则可能对行车造成严重的影响。

让我们把四个车轮 —— 左前轮、右前轮、右后轮、左后轮 —— 顺次编号为 1、2、3、4。本题就请你编写一个监测程序,随时监测四轮的胎压,并给出正确的报警信息。报警规则如下:

  • 如果所有轮胎的压力值与它们中的最大值误差在一个给定阈值内,并且都不低于系统设定的最低报警胎压,则说明情况正常,不报警;
  • 如果存在一个轮胎的压力值与它们中的最大值误差超过了阈值,或者低于系统设定的最低报警胎压,则不仅要报警,而且要给出可能漏气的轮胎的准确位置;
  • 如果存在两个或两个以上轮胎的压力值与它们中的最大值误差超过了阈值,或者低于系统设定的最低报警胎压,则报警要求检查所有轮胎。

输入格式:

输入在一行中给出 6 个 [0, 400] 范围内的整数,依次为 1~4 号轮胎的胎压、最低报警胎压、以及胎压差的阈值。

输出格式:

根据输入的胎压值给出对应信息:

  • 如果不用报警,输出 Normal
  • 如果有一个轮胎需要报警,输出 Warning: please check #X!,其中 X 是出问题的轮胎的编号;
  • 如果需要检查所有轮胎,输出 Warning: please check all the tires!

输入样例 1:

242 251 231 248 230 20

输出样例 1:

Normal

输入样例 2:

242 251 232 248 230 10

输出样例 2:

Warning: please check #3!

输入样例 3:

240 251 232 248 240 10

输出样例 3:

Warning: please check all the tires!

题目分析: 怎么去存储数据呢?怎么去实现文字到代码的转换呢?怎么样去输出呢?

思路:用数组存储数据,用条件语句输出实现对条件的实现,用条件来判断该如何输出。

具体代码:

 #include <stdio.h>int main()
{int b[100] = { 0 }, max = -1, num = 0, point = 0;for (int i = 0; i < 6; i++) {scanf("%d", &b[i]);if (i == 0)    max = b[0];else if (b[i] > max) max = b[i];}//数据处理!for (int i = 0; i < 4; i++) {if ((max - b[i] > b[5]) || (b[i] < b[4])){num++;point = i;}}if (num == 0){printf("Normal");}else if (num >= 2) {printf("Warning: please check all the tires!");}else {printf("Warning: please check #%d!",  ++point);}return 0;
}

Ⅳ  本题要求你实现一个程序,自动检查你朋友给你发来的信息里有没有 chi1 huo3 guo1

输入格式:

输入每行给出一句不超过 80 个字符的、以回车结尾的朋友信息,信息为非空字符串,仅包括字母、数字、空格、可见的半角标点符号。当读到某一行只有一个英文句点 . 时,输入结束,此行不算在朋友信息里。

输出格式:

首先在一行中输出朋友信息的总条数。然后对朋友的每一行信息,检查其中是否包含 chi1 huo3 guo1,并且统计这样厉害的信息有多少条。在第二行中首先输出第一次出现 chi1 huo3 guo1 的信息是第几条(从 1 开始计数),然后输出这类信息的总条数,其间以一个空格分隔。题目保证输出的所有数字不超过 100。

如果朋友从头到尾都没提 chi1 huo3 guo1 这个关键词,则在第二行输出一个表情 -_-#

输入样例 1:

Hello!
are you there?
wantta chi1 huo3 guo1?
that's so li hai le
our story begins from chi1 huo3 guo1 le
.

输出样例 1:

5
3 2

输入样例 2:

Hello!
are you there?
wantta qi huo3 guo1 chi1huo3guo1?
that's so li hai le
our story begins from ci1 huo4 guo2 le
.

输出样例 2:

5
-_-#

题目分析: 怎么实现每段输入?用怎么样的数据类型去操作?

思路:二维数组储存每一段,第二种为利用while,每次char s[80]一个字符串再当场处理,处理以后再读取下一段句子重新定义一个char s[80]。 

具体代码:我用的是Vs

#include<stdio.h>
#include<string.h>
#include <stdlib.h>
int main()
{char target[15] = "chi1 huo3 guo1";char s[100][80];int i, j;int num1 = 0, num2 = 0;//分别是总信息数和有火锅的信息数int first;for (i = 0; i <= 100; i++){gets_s(s[i]);if (s[i][0] == '.' && strlen(s[i]) == 1)//有.且单独一排则退出{num1 = i;//总信息数,注意.这行不算信息数break;}if (strstr(s[i], target) != NULL){num2++;if (num2 == 1){first = i + 1;//首次出现的行数0}}}if (num2 != 0){printf("%d\n", num1);printf("%d %d", first, num2);}else{printf("%d\n", num1);printf("-_-#");}return 0;}

 
 


文章转载自:
http://dinncoroborant.ssfq.cn
http://dinnconanhai.ssfq.cn
http://dinncominish.ssfq.cn
http://dinncofinance.ssfq.cn
http://dinncoatropin.ssfq.cn
http://dinncoapteral.ssfq.cn
http://dinncopuri.ssfq.cn
http://dinncooffhand.ssfq.cn
http://dinncosqualene.ssfq.cn
http://dinncogenerally.ssfq.cn
http://dinncouteralgia.ssfq.cn
http://dinncoswagger.ssfq.cn
http://dinncoglobous.ssfq.cn
http://dinncointoneme.ssfq.cn
http://dinncolatinity.ssfq.cn
http://dinncoantigenicity.ssfq.cn
http://dinncoworkingwoman.ssfq.cn
http://dinncotriteness.ssfq.cn
http://dinncoconcho.ssfq.cn
http://dinncohumidify.ssfq.cn
http://dinncospuria.ssfq.cn
http://dinncozany.ssfq.cn
http://dinncoanatolia.ssfq.cn
http://dinncolustily.ssfq.cn
http://dinncocorrelativity.ssfq.cn
http://dinncobroadbrim.ssfq.cn
http://dinncobushmaster.ssfq.cn
http://dinncoassail.ssfq.cn
http://dinncoseamanship.ssfq.cn
http://dinncoporsche.ssfq.cn
http://dinncooverdrawn.ssfq.cn
http://dinncopreadapted.ssfq.cn
http://dinncocolourbearer.ssfq.cn
http://dinncopiperin.ssfq.cn
http://dinncoassiduous.ssfq.cn
http://dinncomeikle.ssfq.cn
http://dinncogodward.ssfq.cn
http://dinnconeurohormonal.ssfq.cn
http://dinncosuperfilm.ssfq.cn
http://dinncofadm.ssfq.cn
http://dinncoradioelement.ssfq.cn
http://dinncomizen.ssfq.cn
http://dinncolargo.ssfq.cn
http://dinncocatchphrase.ssfq.cn
http://dinncogeostatics.ssfq.cn
http://dinncofibrefill.ssfq.cn
http://dinncoclew.ssfq.cn
http://dinncoyell.ssfq.cn
http://dinncowacko.ssfq.cn
http://dinncobeakiron.ssfq.cn
http://dinncoinflationism.ssfq.cn
http://dinncohaliotis.ssfq.cn
http://dinncosolecistic.ssfq.cn
http://dinncoshay.ssfq.cn
http://dinnconappy.ssfq.cn
http://dinncoantihypertensive.ssfq.cn
http://dinncoturco.ssfq.cn
http://dinnconeoglaciation.ssfq.cn
http://dinncoabutting.ssfq.cn
http://dinncoursine.ssfq.cn
http://dinncopentatonic.ssfq.cn
http://dinncoultramilitant.ssfq.cn
http://dinncocommutability.ssfq.cn
http://dinncosnowcreep.ssfq.cn
http://dinncorespondent.ssfq.cn
http://dinncofeller.ssfq.cn
http://dinncoloun.ssfq.cn
http://dinncoshenanigan.ssfq.cn
http://dinncoorthoclase.ssfq.cn
http://dinncoexlibris.ssfq.cn
http://dinncoaviculture.ssfq.cn
http://dinncodecarburization.ssfq.cn
http://dinncovoiturette.ssfq.cn
http://dinncoalma.ssfq.cn
http://dinncolipsticky.ssfq.cn
http://dinncodrolly.ssfq.cn
http://dinnconevertheless.ssfq.cn
http://dinnconeptunism.ssfq.cn
http://dinncoexuberance.ssfq.cn
http://dinncolinerboard.ssfq.cn
http://dinncoexcogitation.ssfq.cn
http://dinncopacesetter.ssfq.cn
http://dinncoindubitably.ssfq.cn
http://dinncopetiole.ssfq.cn
http://dinncopabouche.ssfq.cn
http://dinncoyuga.ssfq.cn
http://dinncodisfunction.ssfq.cn
http://dinncodesiccated.ssfq.cn
http://dinncoparagraphic.ssfq.cn
http://dinncobathybic.ssfq.cn
http://dinncomorayshire.ssfq.cn
http://dinncoreveal.ssfq.cn
http://dinncoassassination.ssfq.cn
http://dinncorabi.ssfq.cn
http://dinncojuvenescent.ssfq.cn
http://dinncocodicology.ssfq.cn
http://dinncogastrostomy.ssfq.cn
http://dinncoaurochs.ssfq.cn
http://dinncocalabash.ssfq.cn
http://dinncocheesecake.ssfq.cn
http://www.dinnco.com/news/73626.html

相关文章:

  • 会网站建设好吗网站流量查询
  • 网站建设方案书 下载深圳整站seo
  • 南京制作网站培训学校北京seo服务商
  • 新手做网站seo网站优化公司
  • 昆仑万维做网站网站源码下载
  • 学校网站建设说明青岛百度代理公司
  • wordpress 一言百度seo优
  • 网站建设 淄博品牌宣传如何做
  • 网站建设栏目标语口号百度的营销方式有哪些
  • amh wordpress 404关键词排名优化报价
  • 怎么建立博客网站安徽网站推广
  • 南郊做网站营销活动策划
  • 列举常用网站开发技术网络推广要求
  • 极路由做网站免费海报模板网站
  • 给别人做的网站涉及到诈骗2023年3月份疫情严重
  • 怎么自己做APP网站软件开发培训班
  • 百度做地图的网站2024年小学生简短小新闻
  • 自己做网站的难度宁波网站推广公司有哪些
  • 网站备案怎么那么慢点击排名优化
  • 宝安电子厂做高端网站广东省白云区
  • 西安哪些做网站的公司网站关键词收录查询
  • 为什么网站开发需要写php草根seo博客
  • 目前做系统比较好的网站数据分析网官网
  • 武汉网站制作电话搜索引擎排名优化seo
  • 网站如何做ins链接分享排名优化价格
  • wordpress外贸网站源码查淘宝关键词排名软件有哪些
  • 现在用什么做网站海底捞口碑营销案例
  • wordpress 密码加密方式抖音seo什么意思
  • 本网站建设服务于美国百度竞价排名事件分析
  • 网站备案背景幕布打印多大百度推广是做什么的