CodeForces 697B Barnicle 模拟
强行模拟 纪念一下……
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<string>
#include<map>
#include<vector>
#include<queue>
#define M(a,b) memset(a,b,sizeof(a))
using namespace std;
char str[];
char strr[];
queue<int>take;
int main(){
while(~scanf("%s",str)){
M(strr,NULL);
int len=strlen(str);
int i=,j;
while(true){
if(str[i]=='e') break;
else strr[i]=str[i];
if(str[i]=='.') j=i;
i++;
}
// printf("%s\n",strr);
int pow_=len--i;
int ll=str[i+]-'';
for(int k=;str[i+k];k++){
ll*=;
ll+=str[i+k]-'';
}
// printf("ll==%d\n",ll);
while((strr[j+]>=''&&strr[j+]<='')&&ll){
swap(strr[j],strr[j+]);
j++,ll--;
}
// printf("ll==%d\n",ll);
int from=;
while(true){
if(strr[from]=='') from++;
else break;
}
// printf("from==%d\n",from);
if(strr[j-]=='') from--;
if(from<) from=;
int lenn=strlen(strr);
// printf("%d %c %c\n",lenn,strr[lenn-1],strr[lenn-2]);
if(strr[lenn-]=='' && strr[lenn-]=='.'){
for(int q=;q<lenn-;q++)
printf("%c",strr[q]);
puts("");
continue;
}
if(j==i-&&ll==){
// printf("222223\n");
for(int q=from;q<i-;q++)
printf("%c",strr[q]);
puts("");
}
else if(ll!=){
// printf("1111111\n");
for(int q=;strr[q];q++){
if(strr[q]=='.') break;
else printf("%c",strr[q]);
}
while(ll){
printf("");
ll--;
}
puts("");
}
else{
// printf("22222\n");
for(int q=from;q<i;q++)
printf("%c",strr[q]);
puts("");
}
}
return ;
}
CodeForces 697B Barnicle 模拟的更多相关文章
- Codeforces 679B. Barnicle 模拟
B. Barnicle time limit per test: 1 second memory limit per test :256 megabytes input: standard input ...
- codeforces 697B Barnicle
题目链接:http://codeforces.com/problemset/problem/697/B 题目大意: 将科学计数法用十进制表示.[如果类似于7.0应输出7] 解题思路: Java 中 B ...
- 【CodeForces 697B】Barnicle
对科学计数法表示的数,输出其10进制的形式. c++来做,需要考虑这些细节: 当b==0,d==0时,只输出a. 当不需要补零的情况有两种: 一种是刚好是整数,只输出a(注意1.0e1的情况是输出1) ...
- Codeforces 389B(十字模拟)
Fox and Cross Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submi ...
- codeforces 591B Rebranding (模拟)
Rebranding Problem Description The name of one small but proud corporation consists of n lowercase E ...
- Codeforces 626B Cards(模拟+规律)
B. Cards time limit per test:2 seconds memory limit per test:256 megabytes input:standard input outp ...
- Codeforces 631C. Report 模拟
C. Report time limit per test:2 seconds memory limit per test:256 megabytes input:standard input out ...
- CodeForces 382C【模拟】
活生生打成了大模拟... #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef unsig ...
- codeforces 719C (复杂模拟-四舍五入-贪心)
题目链接:http://codeforces.com/problemset/problem/719/C 题目大意: 留坑...
随机推荐
- Everything(速度快的文件搜索软件) 1.4.1.801b 汉化绿色版
软件名称: Everything(速度快的文件搜索软件) 软件语言: 简体中文 授权方式: 免费软件 运行环境: Win7 / Vista / Win2003 / WinXP 软件大小: 2.0MB ...
- SEO之关键词选择
在网站优化中,关键词应该是奠基石,选择好关键词的重要性也不言而喻了.怎样选择合理化的关键词呢?这个是我今天了解到的. 1.选择的关键词首先是有人搜索过的.没人搜索的词优化就是浪费时间. 2.做有效流量 ...
- tomcat设置http自动跳转为https访问
一.生成服务器端证书文件 可以使用Windows系统或者Linux系统 (1)Windows环境 条件:已经安装JDK 步骤: 1.在运行里输入cmd进入命令窗口 2.进入JDK安装目录 如D:/P ...
- CSS IE的bug
没事总结一下IE的各种bug一下内容有一部分各位大神那里摘抄的,请恕小女子无罪: 1.ie6IE 6对margin的 auto 并没有正确的设置 解决方案:最简单的方法是在父元素中使用 text-al ...
- Linux下区分物理CPU、逻辑CPU和CPU核数
㈠ 概念 ① 物理CPU 实际Server中插槽上的CPU个数 物理cpu数量,可以数不重复的 p ...
- c++中小项堆声明和使用【转】
c++默认是大顶堆,小顶堆有两种声明方法: 1.对于基本类型直接用 priority_queue<int, vector<int>, greater<int> >p ...
- CMake如何执行shell命令
我在cmake编译后想执行一些特定的shell命令(执行.lcov收集代码覆盖报告等),我又不想写到XX.sh的shell脚本中,如何直接通过CMake执行shell命令呢? 在网上翻江倒海了一下,找 ...
- ajax对文件上传
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- sql 关于dblink和多条update、insert事务回滚写法
在存储过程的编写中难免会遇到调用同库他人的proc和跨库调用proc,还有一个proc中有多条对多表进行写入和修改的语句.那么就会用到tran. 如果我们在不写try的情况下就要对每个insert,u ...
- 从头开始学Java【1】
1:常见的DOS命令 盘符的切换 d:回车 目录的进入 cd javase cd javase\day01\code 目录的回退 cd.. cd\ 清屏 cls 退出 exit 创建目录 md 删除目 ...