SZU1
2016-03-13 11:11
211 查看
CodeForces 518A
字符串进位。。
字符串进位。。
#include <iostream> #include <string> #include <cstring> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm> #include <stack> #include <queue> #include <cctype> #include <vector> #include <iterator> #include <set> #include <map> #include <sstream> using namespace std; #define mem(a,b) memset(a,b,sizeof(a)) #define pf printf #define sf scanf #define spf sprintf #define pb push_back #define debug printf("!\n") #define INF 10000 #define MAXN 5010 #define MAX(a,b) a>b?a:b #define blank pf("\n") #define LL long long #define ALL(x) x.begin(),x.end() #define INS(x) inserter(x,x.begin()) #define pqueue priority_queue char s[105],t[105]; int main() { int i,j; while(sf("%s%s",s,t)==2) { int len = strlen(s); int x = len-1; for(i=0;i<len;i++) { if(s[x]=='z') { s[x]='a'; x--; } else { s[x]++; break; } } if(!strcmp(s,t)) pf("No such string\n"); else pf("%s\n",s); } }
相关文章推荐
- 第二周学习进度
- STL学习之函数对象
- ubuntu下安装putty
- repo 签出某个Android版本
- 数据库报表
- 第二周学习进度
- 阴天 6℃ 3.12日
- Laravel5.0学习--01 入门
- 详细记录python的range()函数用法
- Java 回顾笔记_多线程_线程通讯1
- Mother's Milk--DFS
- 聚集索引和非聚集索引(整理) 实例讲解
- 白话Spring(中级篇)---MVC
- 将自定义的布局设置给Dialog
- ConcurrentHashMap和HashMap的区别
- mysql数据库表修改某一列的类型
- ios-基础至【5】-NSObject
- POJ 2142 The Balance 扩展欧几里德
- CSS3实现翻转(Flip)效果
- 本地音频播放,使用AVFoundation.framework中的AVAudioPlayer来实现