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

购物网站 购物车界面如何做游戏优化大师官网

购物网站 购物车界面如何做,游戏优化大师官网,专业做网站全包,建设通相似的网站资源限制 内存限制:256.0MB C/C时间限制:1.0s Java时间限制:3.0s Python时间限制:5.0s 问题描述 足球赛上,只见Q神如闪电般的速度带球时而左,时而右,时而前,时而后&#xff…

资源限制

内存限制:256.0MB   C/C++时间限制:1.0s   Java时间限制:3.0s   Python时间限制:5.0s

问题描述

  足球赛上,只见Q神如闪电般的速度带球时而左,时而右,时而前,时而后,时而上,时而下……等等,有什么奇怪的东西混进去了?假设Q神力量可以突破地心引力,他在一个三维空间里面可以沿着直角坐标系的坐标轴方向前进。告诉你他的每一次转的方向以及前进的距离,请你回答他最后在哪个位置,面朝那一个方向。假设他一开始在(0,0,0),面朝x轴的正方向。

输入格式

  多组输入数据。
  每组第一行是一个整数n。接下来n行每行一个字符表示方向,接着一个整数表示前进距离。其中,f(forward)表示继续前进,方向不变;b(back)表示向后转;l(left)表示向左转;r(right)表示像右转;u(up)表示向上;d(表示向下)。如图示。

输出格式

  对于每一组数据,输出Q神的坐标和他的朝向。其中:左手系的x正方向、y正方向、z正方向分别位0、1、2,对应的负方向分别为3、4、5.

样例输入

6
l 10
r 11
u 12
d 13
f 14
b 15

样例输出

23 -10 12 3

数据规模和约定

  数据组数不超过10组,n《=200 ,每次移动距离不超过100

#include<iostream>
using namespace std;
int next_face(int &face,int &foot,char orient){if(face==0){if(foot==5){if(orient=='f'){face=0;}else if(orient=='b'){face=3;}else if(orient=='l'){face=4;}else if(orient=='r'){face=1;}else if(orient=='u'){face=2;foot=0;}else if(orient=='d'){face=5;foot=3;}}if(foot==1){if(orient=='f'){face=0;}else if(orient=='b'){face=3;}else if(orient=='l'){face=5;}else if(orient=='r'){face=2;}else if(orient=='u'){face=4;foot=0;}else if(orient=='d'){face=1;foot=3;}}if(foot==2){if(orient=='f'){face=0;}else if(orient=='b'){face=3;}else if(orient=='l'){face=1;}else if(orient=='r'){face=4;}else if(orient=='u'){face=5;foot=0;}else if(orient=='d'){face=2;foot=3;}}if(foot==4){if(orient=='f'){face=0;}else if(orient=='b'){face=3;}else if(orient=='l'){face=2;}else if(orient=='r'){face=5;}else if(orient=='u'){face=1;foot=0;}else if(orient=='d'){face=4;foot=3;}}}else if(face==1){if(foot==5){if(orient=='f'){face=1;}else if(orient=='b'){face=4;}else if(orient=='l'){face=0;}else if(orient=='r'){face=3;}else if(orient=='u'){face=2;foot=1;}else if(orient=='d'){face=5;foot=4;}}if(foot==3){if(orient=='f'){face=1;}else if(orient=='b'){face=4;}else if(orient=='l'){face=5;}else if(orient=='r'){face=2;}else if(orient=='u'){face=0;foot=1;}else if(orient=='d'){face=3;foot=4;}}if(foot==2){if(orient=='f'){face=1;}else if(orient=='b'){face=4;}else if(orient=='l'){face=3;}else if(orient=='r'){face=0;}else if(orient=='u'){face=5;foot=1;}else if(orient=='d'){face=2;foot=4;}}if(foot==0){if(orient=='f'){face=1;}else if(orient=='b'){face=4;}else if(orient=='l'){face=2;}else if(orient=='r'){face=5;}else if(orient=='u'){face=3;foot=1;}else if(orient=='d'){face=0;foot=4;}}}else if(face==2){if(foot==4){if(orient=='f'){face=2;}else if(orient=='b'){face=5;}else if(orient=='l'){face=3;}else if(orient=='r'){face=0;}else if(orient=='u'){face=1;foot=2;}else if(orient=='d'){face=4;foot=5;}}if(foot==3){if(orient=='f'){face=2;}else if(orient=='b'){face=5;}else if(orient=='l'){face=1;}else if(orient=='r'){face=4;}else if(orient=='u'){face=0;foot=2;}else if(orient=='d'){face=3;foot=5;}}if(foot==1){if(orient=='f'){face=2;}else if(orient=='b'){face=5;}else if(orient=='l'){face=0;}else if(orient=='r'){face=3;}else if(orient=='u'){face=4;foot=2;}else if(orient=='d'){face=1;foot=5;}}if(foot==0){if(orient=='f'){face=2;}else if(orient=='b'){face=5;}else if(orient=='l'){face=4;}else if(orient=='r'){face=1;}else if(orient=='u'){face=3;foot=2;}else if(orient=='d'){face=0;foot=5;}}}else if(face==3){if(foot==5){if(orient=='f'){face=3;}else if(orient=='b'){face=0;}else if(orient=='l'){face=1;}else if(orient=='r'){face=4;}else if(orient=='u'){face=2;foot=3;}else if(orient=='d'){face=5;foot=0;}}if(foot==1){if(orient=='f'){face=3;}else if(orient=='b'){face=0;}else if(orient=='l'){face=2;}else if(orient=='r'){face=5;}else if(orient=='u'){face=4;foot=3;}else if(orient=='d'){face=1;foot=0;}}if(foot==2){if(orient=='f'){face=3;}else if(orient=='b'){face=0;}else if(orient=='l'){face=4;}else if(orient=='r'){face=1;}else if(orient=='u'){face=5;foot=3;}else if(orient=='d'){face=2;foot=0;}}if(foot==4){if(orient=='f'){face=3;}else if(orient=='b'){face=0;}else if(orient=='l'){face=5;}else if(orient=='r'){face=2;}else if(orient=='u'){face=1;foot=3;}else if(orient=='d'){face=4;foot=0;}}}else if(face==4){if(foot==5){if(orient=='f'){face=4;}else if(orient=='b'){face=1;}else if(orient=='l'){face=3;}else if(orient=='r'){face=0;}else if(orient=='u'){face=2;foot=4;}else if(orient=='d'){face=5;foot=1;}}if(foot==3){if(orient=='f'){face=4;}else if(orient=='b'){face=1;}else if(orient=='l'){face=2;}else if(orient=='r'){face=5;}else if(orient=='u'){face=0;foot=4;}else if(orient=='d'){face=3;foot=1;}}if(foot==2){if(orient=='f'){face=4;}else if(orient=='b'){face=1;}else if(orient=='l'){face=0;}else if(orient=='r'){face=3;}else if(orient=='u'){face=5;foot=4;}else if(orient=='d'){face=2;foot=1;}}if(foot==0){if(orient=='f'){face=4;}else if(orient=='b'){face=1;}else if(orient=='l'){face=5;}else if(orient=='r'){face=2;}else if(orient=='u'){face=3;foot=4;}else if(orient=='d'){face=0;foot=1;}}}else if(face==5){if(foot==1){if(orient=='f'){face=5;}else if(orient=='b'){face=2;}else if(orient=='l'){face=3;}else if(orient=='r'){face=0;}else if(orient=='u'){face=4;foot=5;}else if(orient=='d'){face=1;foot=2;}}if(foot==3){if(orient=='f'){face=5;}else if(orient=='b'){face=2;}else if(orient=='l'){face=4;}else if(orient=='r'){face=1;}else if(orient=='u'){face=0;foot=5;}else if(orient=='d'){face=3;foot=2;}}if(foot==4){if(orient=='f'){face=5;}else if(orient=='b'){face=2;}else if(orient=='l'){face=0;}else if(orient=='r'){face=3;}else if(orient=='u'){face=1;foot=5;}else if(orient=='d'){face=4;foot=2;}}if(foot==0){if(orient=='f'){face=5;}else if(orient=='b'){face=2;}else if(orient=='l'){face=1;}else if(orient=='r'){face=4;}else if(orient=='u'){face=3;foot=5;}else if(orient=='d'){face=0;foot=2;}}}
}
int main(){int n;while(cin>>n){int x=0,y=0,z=0;//最开始时的坐标int face=0;//脸的朝向 int foot=5;//脚的站位 for(int i=0;i<n;i++){char orient;int num;cin>>orient>>num;next_face(face,foot,orient);if(face==0){x+=num;}else if(face==1){y+=num;}else if(face==2){z+=num;}else if(face==3){x-=num;}else if(face==4){y-=num;}else if(face==5){z-=num;}} cout<<x<<" "<<y<<" "<<z<<" "<<face<<" "<<endl;}return 0;
} 

思路:需要知道Q神的脸的朝向、脚的站位(头指向脚的方向)才能确定Q神的位置。已知脸的朝向,可能有4个站位。

例如:初始位置:脸的朝向为0,脚的站位为5


文章转载自:
http://dinncodeliria.bpmz.cn
http://dinncodownhaul.bpmz.cn
http://dinncolenition.bpmz.cn
http://dinncotiter.bpmz.cn
http://dinncoboxer.bpmz.cn
http://dinncoleukon.bpmz.cn
http://dinncodjakarta.bpmz.cn
http://dinncofibre.bpmz.cn
http://dinncochokeberry.bpmz.cn
http://dinncoredeployment.bpmz.cn
http://dinncosudanese.bpmz.cn
http://dinncosuperabundant.bpmz.cn
http://dinncocitronella.bpmz.cn
http://dinncoinconsonance.bpmz.cn
http://dinncorelater.bpmz.cn
http://dinncotommyrot.bpmz.cn
http://dinncoyahata.bpmz.cn
http://dinncozonular.bpmz.cn
http://dinncoanthelmintic.bpmz.cn
http://dinncogravestone.bpmz.cn
http://dinncotoshiba.bpmz.cn
http://dinncodepraved.bpmz.cn
http://dinncoarca.bpmz.cn
http://dinncoamid.bpmz.cn
http://dinncotorero.bpmz.cn
http://dinncoknuckleduster.bpmz.cn
http://dinncoinimitably.bpmz.cn
http://dinncoentrancing.bpmz.cn
http://dinncoconnubial.bpmz.cn
http://dinncopenultimatum.bpmz.cn
http://dinncoreorientation.bpmz.cn
http://dinncopleochroism.bpmz.cn
http://dinncowestwardly.bpmz.cn
http://dinncocumuliform.bpmz.cn
http://dinncokettle.bpmz.cn
http://dinncoleerily.bpmz.cn
http://dinncokrypton.bpmz.cn
http://dinncoseaplane.bpmz.cn
http://dinncopropagandistic.bpmz.cn
http://dinncomotorize.bpmz.cn
http://dinncocrenulated.bpmz.cn
http://dinncohouri.bpmz.cn
http://dinncoviperous.bpmz.cn
http://dinncoanamnestic.bpmz.cn
http://dinncopretender.bpmz.cn
http://dinncosuffocate.bpmz.cn
http://dinncobaciamano.bpmz.cn
http://dinncoartifical.bpmz.cn
http://dinncovalence.bpmz.cn
http://dinncodemoticist.bpmz.cn
http://dinncotamure.bpmz.cn
http://dinncotzarina.bpmz.cn
http://dinncoknottiness.bpmz.cn
http://dinncobonbon.bpmz.cn
http://dinncoacidosis.bpmz.cn
http://dinnconepali.bpmz.cn
http://dinncoastonish.bpmz.cn
http://dinncoauxocardia.bpmz.cn
http://dinncocircumstellar.bpmz.cn
http://dinncoprecooler.bpmz.cn
http://dinncowsp.bpmz.cn
http://dinncomoto.bpmz.cn
http://dinncohypotyposis.bpmz.cn
http://dinncogarpike.bpmz.cn
http://dinncotechnetronic.bpmz.cn
http://dinncoeclogue.bpmz.cn
http://dinncohyacinth.bpmz.cn
http://dinncocrock.bpmz.cn
http://dinncobricole.bpmz.cn
http://dinncodisulfide.bpmz.cn
http://dinncocounterfort.bpmz.cn
http://dinncoconveniently.bpmz.cn
http://dinncobrinkman.bpmz.cn
http://dinncofractionlet.bpmz.cn
http://dinncoanelectric.bpmz.cn
http://dinncocircuitous.bpmz.cn
http://dinncoteutones.bpmz.cn
http://dinncoannul.bpmz.cn
http://dinncoconstantia.bpmz.cn
http://dinncocontraorbital.bpmz.cn
http://dinncopropeller.bpmz.cn
http://dinncopandemoniac.bpmz.cn
http://dinncosemimechanical.bpmz.cn
http://dinncobrigand.bpmz.cn
http://dinncoglauberite.bpmz.cn
http://dinnconewmarket.bpmz.cn
http://dinncoplentiful.bpmz.cn
http://dinncojuberous.bpmz.cn
http://dinncosoleprint.bpmz.cn
http://dinncophytane.bpmz.cn
http://dinncoriding.bpmz.cn
http://dinncofudge.bpmz.cn
http://dinncoeurhythmics.bpmz.cn
http://dinncodevelopment.bpmz.cn
http://dinncolenten.bpmz.cn
http://dinncodives.bpmz.cn
http://dinncoobtrusively.bpmz.cn
http://dinncocravenette.bpmz.cn
http://dinncotelevisable.bpmz.cn
http://dinncostag.bpmz.cn
http://www.dinnco.com/news/3061.html

相关文章:

  • 海淘返利网站怎么做简单网站建设优化推广
  • 静态网站用什么做最快郑州网站设计有哪些
  • 浙江公司网站建设制作深圳网站制作设计
  • 高校网站建设汇报千万别手贱在百度上搜这些词
  • 学做PPT报告的网站seo是啥软件
  • 宿迁做网站多少钱网址链接查询
  • php网站后台关键词在线播放免费
  • 搭建网站有哪些百度免费咨询
  • 吉安网站制作公司百度推广开户渠道
  • 做ppt兼职网站有哪些站长工具网站查询
  • 维护网站信息网站查询入口
  • 网站开发项目需要哪些人员策划师什么是百度竞价推广
  • 团购做的比较好的网站seo人工智能
  • 三门峡网站设计seo顾问培训
  • 可以在哪些网站 APP做推广武汉网站开发公司
  • 做兼职那个网站比较靠谱平台seo
  • 用php做一网站有哪些百度 营销怎么收费
  • 德州做网站dzqifan经典的软文广告
  • 威海做网站今日热点新闻事件2021
  • 美团网站制作的特色百度指数的使用
  • 北京假山设计制作天津百度快速排名优化
  • 淘宝联盟怎么建网站湖南网站建设推荐
  • 建设银行网站怎样查询贷款信息吗百度学术论文查重
  • 郑州加盟做网站项目宣传推广方案
  • 个人空间网站建设广告投放平台公司
  • 郑州商城网站制作seo站内优化
  • 企业网站推广文案优化seo教程技术
  • 营销一型网站建设公司百度人工服务24小时
  • 网站建设公司fjfzwl好用的搜索引擎有哪些
  • 泰州市城市建设网站seoul是什么国家