Sicily 1510欢迎提出优化方案
这道题我觉得是除1000(A-B)外最简单的题了……不过还是提出一个小问题:在本机用gcc编译的时候我没包括string.h头文件,通过编译,为什么在sicily上却编译失败?
1510. Mispelling
限制条件
时间限制: 1 秒, 内存限制: 32 兆
题目描述
Misspelling is an art form that students seem to excel at. Write a program that removes the n <tex2html_verbatim_mark>th character from an input string.
输入格式
The first line of input contains a single integer N <tex2html_verbatim_mark>, (1≤N≤1000) <tex2html_verbatim_mark>which is the number of datasets that follow.
Each dataset consists of a single line of input containing M <tex2html_verbatim_mark>, a space, and a single word made up of uppercase letters only. M <tex2html_verbatim_mark>will be less than or equal to the length of the word. The length of the word is guaranteed to be less than or equal to 80.
输出格式
For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, and the misspelled word. The misspelled word is the input word with the indicated character deleted.
样例输入
4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON
样例输出
1 MISPELL
2 ROGRAMMING
3 CONTES
4 BALOON
题目来源
Greater New York 2007
#include<stdio.h>
//#include<string.h>
int main()
{
int N,count=;
scanf("%d",&N);
while(N--){
int M,i;
char str[];
scanf("%d %s",&M,str);
int len=strlen(str);
for(i=M-;i<len;i++) str[i]=str[i+];
str[len]='\0';
printf("%d %s\n",count,str);
count++;
}
return ;
}
Sicily 1510欢迎提出优化方案的更多相关文章
- Sicily 1068欢迎提出优化方案
1608. Digit Counting 限制条件 时间限制: 1 秒, 内存限制: 32 兆 题目描述 Trung is bored with his mathematics homeworks. ...
- sicily 1200欢迎提出优化方案
水题来的……我的做法是用a[10]数组表示每个数字出现的次数. 1200. Stick 限制条件 时间限制: 1 秒, 内存限制: 32 兆 题目描述 Anthony has collected a ...
- iOS界面跳转的一些优化方案
原文地址: http://blog.startry.com/2016/02/14/Think-Of-UIViewController-Switch/ iOS界面跳转的一些优化方案 App应用程序开发, ...
- (转)Web性能优化方案
第一章 打开网站慢现状分析 在公司访问部署在IDC机房的VIP网站时会感觉很慢.是什么原因造成的?为了缩短页面的响应时间,改进我们的用户体验,我们需要知道用户的时间花在等待什么东西上. 可以跟踪一下我 ...
- AngularJS应用页面切换优化方案
葡萄城的一款尚在研发中的产品,对外名称暂定为X项目.其中使用了已经上市的Wijmo中SpreadJS产品,另外,在研发过程中整理了一些研发总结分享给大家.如本篇的在页面切换的过程中优化方案,欢迎大家跟 ...
- AngularJs应用页面切换优化方案(转)
目录[-] 前言 场景 使用resolve来提前请求数据 为页面加入切换动画 总结 葡萄城的一款尚在研发中的产品,对外名称暂定为X项目.其中使用了已经上市的wijmo中SpreadJS产品,另外,在研 ...
- Adapter优化方案的探索
概要:使用Adapter的注意事项与优化方案本文的例子都可以在结尾处的示例代码连接中看到并下载,如果喜欢请star,如果觉得有纰漏请提交issue,如果你有更好的点子可以提交pull request. ...
- Web性能优化方案
第一章 打开网站慢现状分析 在公司访问部署在IDC机房的VIP网站时会感觉很慢.是什么原因造成的?为了缩短页面的响应时间,改进我们的用户体验,我们需要知道用户的时间花在等待什么东西上. 可以跟踪一下我 ...
- 大批量delete 优化方案
超过100万以上数据 删除的时候 会非常慢且产生大量日志文件 最大的问题是内存爆表 导致得多次重启服务才能删除整个库 暂时提出初步优化方案 1.设置日志为简单模式,处理完后恢复 ALTER DATAB ...
随机推荐
- 判断一个Bitmap图像是否是.9图
见BitmapFactory的源码中 byte[] np = bm.getNinePatchChunk(); final boolean isNinePatch = np != null & ...
- 【转载】如何将Emmet安装到到 Sublime text 3?
http://www.cnblogs.com/tinyphp/p/3217457.html 看清楚哦~~这是Sublime text 3不是2的版本,两者的安装还是有区别的,下面的方法是我感觉比较简单 ...
- 【转】linux中的sed命令
转自:http://www.cnblogs.com/shineshqw/articles/1978122.html 功能说明: 利用script来处理文本文件. 语 法:sed [-hnV][-e&l ...
- ThinkPHP CURD方法盘点:order方法
order方法属于模型的连贯操作方法之一,用于对操作的结果排序. 用法 $Model->where('status=1')->order('id desc')->limit(5)-& ...
- [React Native] Using the Image component and reusable styles
Let's take a look at the basics of using React Native's Image component, as well as adding some reus ...
- OSI七层模型具体解释
OSI 七层模型通过七个层次化的结构模型使不同的系统不同的网络之间实现可靠的通讯,因此其最基本的功能就是帮助不同类型的主机实现传输数据 . 完毕中继功能的节点通常称为中继系统.在OSI七层模型中,处于 ...
- iOS开发——数据持久化Swift篇&SettingBundle
SettingBundle import UIKit class ViewController: UIViewController { var userDefault = NSUserDefaults ...
- 关于Java中return和finally谁先执行.
例子一: public class A { public static void main(String[] args) { System.out.print(tt()); } public stat ...
- MATLAB的基本元素
MALTAB程序的基本数据单元是数组,MATLAB 的变量名必须以字母开头,后面可以跟字母,数字和下划线(_).只有前31个字符是有效的:如果超过了31 个字符,基余的字符将被忽略.如果声明两个变量, ...
- iis7 php urlrewrite 并隐藏index.php
<rewrite> <rules> <rule name="OrgPage" stopProcessing="true"> ...