31、刪除公共字元
(個人水平有限,請見諒!)
題目描述:
輸入兩個字串,從第一字串中刪除第二個字串中所有的字元。例如,輸入”They are students.”和”aeiou”,則刪除之後的第一個字串變成”Thy r stdnts.”
輸入描述:
每個測試輸入包含2個字串
輸出描述:
輸出刪除後的字串
輸入:
They are students.
aeiou
輸出:
Thy r stdnts.
程式碼示例:
#include <iostream> #include <string> using namespace std; int main() { string str,del; getline(cin,str); getline(cin,del); for (int i = 0; i < del.length(); i++) for (int j = 0; j < str.length(); j++) if (del[i] == str[j]) str.erase(j--,1); cout << str; }
相關推薦
31、刪除公共字元
(個人水平有限,請見諒!) 題目描述: 輸入兩個字串,從第一字串中刪除第二個字串中所有的字元。例如,輸入”They are students.”和”aeiou”,則刪除之後的第一個字串變成”Thy r stdnts.” 輸入描述: 每個測試輸入包含2個字串 輸出
刪除公共字元
輸入兩個字串,從第一字串中刪除第二個字串中所有的字元。例如,輸入”They are students.”和”aeiou”,則刪除之後的第一個字串變成”Thy r stdnts.” 輸入描述: 每個測試輸入包含2個字串 輸出描述: 輸出刪除後的字串 輸入例子1:
陣列和字串操作(C#) 1、從字串中刪除指定字元
從字串中刪除指定的字元,如從字串this is an apple刪除aeiou字元 輸出:ths s n ppl 看到斑竹的部落格,覺得用正則更簡單些,特貼出來 /// <summary> /// 刪除字串中的指定字元 用正則,需要引用Sys
mysql 添加字段、刪除字段、調整字段順序
column var drop 類型 base 技術分享 知識 ron 修改 用過MySQL的朋友,可能都在使用phpMyAdmin,我從2003年開始使用,感覺那東西適合遠程mysql管理,並 不適合單機、單數據庫的管理操作,特別是開發使用。 給家推薦一個軟件管理
jquery DOM 創建、插入、刪除
png 兄弟節點 div listener mage ron reat ... fun 1.創建元素節點: $("<div></div>") 2.創建文本節點,與創建元素節點類似,可以直接把文本內容一並描述 $("<div>我是文本
【iOS開發-51】案例學習:動畫新寫法、刪除子視圖、視圖順序、延遲方法、button多功能使用方法及icon圖標和啟動頁設置
無法查看 font targe 技術 value lstat tostring sta dict 案例效果: (1)導入所需的素材,然後用storyboard把上半截位置和大小相對固定的東西布局起來。當然,這些控件也要定義成對應地IBOutlet和IBActio
NSCharacterSet去除字符串中的空格、刪除指定任意字符集
lte abcd egit 技術 cte smu pre alpha eof 一.去除首尾的空格 /** 1.去除首尾的空格*/ NSString *strMsg=@" 簡書作者:CoderZb "; NSString *strResult =
Hololens創建、讀取、刪除本地文件
方式 finding ati blog color http tps ans 網頁 參考資料 1.微軟官方介紹 saving and finding your files https://developer.microsoft.com/en-us/windows/mixed
fdisk使用(分區查看、新建、刪除等)
linuxfdisk命令 1、磁盤分區管理工具,對於一塊硬盤來講,fdisk最多只能管理15個分區。 2、fdisk使用: fdisk -l [device...] fdisk子命令: P:print顯示已有分區
分針網——IT教育:JS設置cookie、讀取cookie、刪除cookie
JS cookie Js操作Cookie總結(設置,讀取,刪除),工作中經常會用到的哦!下面是詳細代碼,如有錯誤,請留言指正! JavaScript是運行在客戶端的腳本,因此一般是不能夠設置Session的,因為Session是運
DOM4j解析、修改、刪除、增加、保存XML的方法
exceptio set null 增加 gb2 itl str owin chang //XML文件 <?xml version="1.0" encoding="gb2312"?> <PhoneInfo> <Brand name="華為
sqlserver表、視圖、索引(創建、修改、刪除)相關示例
sqlserver表、視圖、索引一、表相關1、創建USE [test] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Ceshi]( [id] [int] NOT NULL, [name] [varch
[linux][mysql] 命令更改表結構:添加、刪除、修改字段、調整字段順序
.com col inf size type unsigned rim alter name 原文出處:http://www.phpernote.com/MySQL/1120.html 1 常用的通過mysql命令來更改表結構的一些sql語句,包括添加、刪除、修改字
Cookie的存儲、獲取、刪除操作
.get expires get string -1 urn pre var win var Cookie={ set: function (name, value, days) { var d = new Date; d.se
Git查看、刪除、重命名遠程分支和tag
arr 錯誤 archive 1.7 rac 人在 post upd local 本文鏈接:http://zengrong.net/post/1746.htm 這篇文章記錄我在使用git的過程中碰到遠程分支和tag的相關內容,提綱: 查看遠程分支 刪除遠程分支和tag
啟動、停止、刪除Windows服務
勞動力 ech nbsp onf config reat service .... pause 啟動: @echo.服務啟動...... @echo off @sc create Service_SMS binPath= "D:\公司制度等文件\項目\河北勞動力市場檢
Mysql數據庫理論基礎之七--插入、刪除、更新語句
插入、刪除、更新語句一、簡介由MySQL AB公司開發,是最流行的開放源碼SQL數據庫管理系統,主要特點:1、是一種數據庫管理系統2、是一種關聯數據庫管理系統3、是一種開放源碼軟件,且有大量可用的共享MySQL軟件4、MySQL數據庫服務器具有快速、可靠和易於使用的特點5、MySQL服務器工作在客戶端/服務器
java文件和文件夾復制、刪除、移動操作
iter create ins target sta temp 文本 read get [java] view plain copy import java.io.File; import java.io.FileInputStream; import
26、刪除有序數組中的元素,數組仍然有序
amp sca 代碼 bool style log 顯示 兩個 成員 刪除有序數組中的元素,數組仍然有序 方法一: 刪除一個有序數組的一個元素,采用兩個數組實現 代碼實現: /* 2017年6月19日16:16:31 功能:刪除數組中一個數據之後數組依然有序 */ #
RecyclerView動態添加、刪除及點擊事件
animator ttext per random param init err count text 上一節講解了RecyclerView的三種顯示方式,本節將主要研究一下RecyclerView的動態添加、刪除及其單擊和長按事件的處理。我們在上一節代碼的基礎上進行相關操