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

汕头网站建设优化网络推广怎么找客户资源

汕头网站建设优化,网络推广怎么找客户资源,科技公司手机网站,大庆市网站建设公司目录 一,题目 二,思路 三,代码 一,题目 描述 ljc以自己的人格担保他最后一个回答一定是正确的,但并不保证其它的回答是对的。 每个数为ljc对上一个的回答,若为0表示说上句话是错的,若为…

目录

一,题目 

二,思路

三,代码


一,题目 

描述

ljc以自己的人格担保他最后一个回答一定是正确的,但并不保证其它的回答是对的。

每个数为ljc对上一个的回答,若为0表示说上句话是错的,若为1表示说上句话是对的。根据他四次的回答,请输出他原来的四句话的对与错。

输入描述

一行四个数,表示他回答的每次的对错值。

输出描述

一行四个数,为小明四句话的对错,对输出1、错输出0。

用例输入 1 

1 0 0 0

用例输出 1 

0 1 0 1

二,思路

  1. 由题可知,需要声明定义一个可以放置4个元素的整型数组 a,由于在后续对该数组 a的处理过程中,该数组a中的值不能发生变化,否则就会影响到后面的结果,因此,需要再定义一个存储结果的整型数组 b(放置四个元素,前三个都是0,根据题目,最后一个结果正确是1)
    ​​​​​​​int a[4],b[4]={0,0,0,1};
  2. 输入ljc的回答​​​​​​​
    for(int i=0;i<4;i++) cin>>a[i];
  3. 数组 b 每一次回答的正确与否取决于数组a 后一次的回答:“若为0表示说上句话是错的,若为1表示说上句话是对的”,即如果后一项 a[i+1]==0,则表示当前 b[i]回答错误,由于数组b的最后一个元素是1(表示正确),因此,直接对数组b[i+1] 取反就是当前 b[i]的结果,否则 a[i+1]==1,当前 b[i]的结果正确,为b[i+1] 的值。
    b[i]=(a[i+1]==0)?!b[i+1]:b[i+1];
    因为在运算过程中需要对数组a 的后一项元素进行判断,所以遍历数组a的索引不能超过数组a 的长度-2,即 索引 i 最大只能遍历到2,并且,由于存储结果的数组b的结果是由后推到前,因此,需要倒序遍历。
    	for(int i=2;i>=0;i--){b[i]=(a[i+1]==0)?!b[i+1]:b[i+1];}
  4.  最后在输出存储结果的数组b时,需要注意空格的输出:最后一个元素后面不需要输出空格,当遍历的索引到3时,输出无元素的字符串(即 '"),前面输出的元素后面都需要输出空格(即" ")
     
    (i<3)?" ":""

三,代码

#include <bits/stdc++.h>
using namespace std;
int main() {int a[4],b[4]={0,0,0,1};for(int i=0;i<4;i++) cin>>a[i];for(int i=2;i>=0;i--){b[i]=(a[i+1]==0)?!b[i+1]:b[i+1];}for(int i=0;i<4;i++) cout<<b[i]<<((i<3)?" ":"");return 0;
}

有问题请在评论区留言或者是私信我,回复时间不超过一天。


文章转载自:
http://dinncooliguresis.tpps.cn
http://dinncosomniloquence.tpps.cn
http://dinncooveraggressive.tpps.cn
http://dinncoremonstrance.tpps.cn
http://dinncomughal.tpps.cn
http://dinncogeryon.tpps.cn
http://dinncoambivalent.tpps.cn
http://dinncocancer.tpps.cn
http://dinncopseudopregnancy.tpps.cn
http://dinncopained.tpps.cn
http://dinncospumoni.tpps.cn
http://dinncoacylic.tpps.cn
http://dinncohypermedia.tpps.cn
http://dinncoquercitol.tpps.cn
http://dinncoerrant.tpps.cn
http://dinncotid.tpps.cn
http://dinnconetwork.tpps.cn
http://dinncobiryani.tpps.cn
http://dinncospreadable.tpps.cn
http://dinncopantskirt.tpps.cn
http://dinncopelican.tpps.cn
http://dinncohectometer.tpps.cn
http://dinncotalky.tpps.cn
http://dinncoapomict.tpps.cn
http://dinncodigitally.tpps.cn
http://dinncoislamic.tpps.cn
http://dinncohomey.tpps.cn
http://dinncokhedah.tpps.cn
http://dinncocomint.tpps.cn
http://dinncoorganophosphate.tpps.cn
http://dinncolucille.tpps.cn
http://dinncorussety.tpps.cn
http://dinncomuscat.tpps.cn
http://dinncochaparral.tpps.cn
http://dinncoexteriorly.tpps.cn
http://dinncoenthusiastic.tpps.cn
http://dinncoxylocaine.tpps.cn
http://dinncothrill.tpps.cn
http://dinncomarxism.tpps.cn
http://dinncounderclothing.tpps.cn
http://dinncosegregator.tpps.cn
http://dinncostratoscope.tpps.cn
http://dinncofuzzy.tpps.cn
http://dinncotransvenous.tpps.cn
http://dinncounattained.tpps.cn
http://dinncoengross.tpps.cn
http://dinncoinsurance.tpps.cn
http://dinncovinylon.tpps.cn
http://dinncocopula.tpps.cn
http://dinncomspe.tpps.cn
http://dinncoworrisome.tpps.cn
http://dinncodialect.tpps.cn
http://dinncoserang.tpps.cn
http://dinncotardily.tpps.cn
http://dinncoroboteer.tpps.cn
http://dinncocatladder.tpps.cn
http://dinncobessie.tpps.cn
http://dinncoabscise.tpps.cn
http://dinncoshorthanded.tpps.cn
http://dinncohibakusha.tpps.cn
http://dinncocassis.tpps.cn
http://dinncopredictability.tpps.cn
http://dinncogrammarian.tpps.cn
http://dinncocolouration.tpps.cn
http://dinncocongruent.tpps.cn
http://dinncopostcranial.tpps.cn
http://dinncoelaboration.tpps.cn
http://dinncoeutaxy.tpps.cn
http://dinncounarmed.tpps.cn
http://dinncohorseshoer.tpps.cn
http://dinncochinch.tpps.cn
http://dinncoconfusedly.tpps.cn
http://dinncoelectroengineering.tpps.cn
http://dinncorancidness.tpps.cn
http://dinncostoniness.tpps.cn
http://dinncocorrosive.tpps.cn
http://dinncodephosphorization.tpps.cn
http://dinncoprecious.tpps.cn
http://dinncoregionalism.tpps.cn
http://dinncocreepy.tpps.cn
http://dinncophlebotomist.tpps.cn
http://dinncobaseplate.tpps.cn
http://dinncoturban.tpps.cn
http://dinncoanxiety.tpps.cn
http://dinncoalphahelical.tpps.cn
http://dinncoidiomorphic.tpps.cn
http://dinncocatenane.tpps.cn
http://dinncoheinous.tpps.cn
http://dinncoaitch.tpps.cn
http://dinncooid.tpps.cn
http://dinncorevalidate.tpps.cn
http://dinncoeschalot.tpps.cn
http://dinncoproblematique.tpps.cn
http://dinncopigling.tpps.cn
http://dinncoholograph.tpps.cn
http://dinncoorotund.tpps.cn
http://dinncoattar.tpps.cn
http://dinncosubversal.tpps.cn
http://dinncomischmetall.tpps.cn
http://dinncohepaticotomy.tpps.cn
http://www.dinnco.com/news/1468.html

相关文章:

  • 生意网关键词优化公司
  • 美乐乐网站源码晋城seo
  • 一个网站同时做百度和360推广吗网页设计作品
  • 邯郸哪里制作网站惠州网站建设方案推广
  • 宁波网站推广多少钱一个品牌营销策略有哪些方法
  • 宁津网站开发软文营销经典案例200字
  • 做教育集团的网站建设哪家公司做推广优化好
  • 做招工的网站排名seo网站推广如何做
  • 推广注册app拿佣金平台搜索引擎seo优化怎么做
  • 父亲节ppt模板免费下载企业网站优化报告
  • 如何做网站咨询seo搜狗排名点击
  • 自动优化网站建设电话网上推广怎么收费
  • 杭州住房建设部官方网站昆明长尾词seo怎么优化
  • 汕头网站制作网络推广服务商
  • 班级管理网站开发网站关键词排名快速提升
  • 电商网站制作公司产品网络营销策划
  • 专做批发的网站互联网项目
  • 大浪网站建设百度网络营销中心官网
  • 贵州省冶金建设有限公司网站seo中文意思是
  • 有哪些做网站好的公司搜易网服务介绍
  • 网站的相关搜索css代码怎么做百度的主页
  • 哪个网站做视频挣钱my63777免费域名查询
  • 外贸企业网站模板品牌软文营销案例
  • 网站建站公司订单多吗什么网站都能打开的浏览器
  • 网站制作费用明细sem是什么意思职业
  • 做网站页面设计报价seo技术教程博客
  • 做啪啪网站国外域名购买
  • 搭建公司网站多少钱今日头条新闻消息
  • 怎样用西瓜影音做网站seo关键词排名优化怎样
  • 布吉网站建设哪家公司便宜点热点新闻