首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
20082123
2024年3月28日 16:06
字符移动 题解:
P1012
回复 0
|
赞 2
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main(){ string s; int j=0; cin>>s; char a[105]={0}; for(int i=0;i<s.size();i++) if(s[i]<&...
光明守护神
2024年3月17日 10:19
C++
P1012
回复 0
|
赞 0
|
浏览 1.2k
#include<iostream> using namespace std; int main() { string s; cin >> s; int j = 0; for (auto i = s.begin(); j < s.size(); j++) { if (*i >= '0' && *i <= '9') { s.push_back(*i); i = s.erase(i); } else { i++; } } cout &...
小酒
2024年3月15日 15:29
字符移动 题解:
P1012
回复 0
|
赞 0
|
浏览 1.4k
1012解题思路 #include <bits/stdc++.h> #include <string.h> using namespace std; int main() { char a[105]={0};//j char b[105]={0};//i gets(a); int l=strlen(a); int i=0; int j=0; for(j=0;j<l;j++) { if(a[j]>='0'&&a[j]<='9') { b[i]=a[j]; ...
lingdongyang
2024年3月15日 11:08
字符移动 题解:
P1012
回复 0
|
赞 3
|
浏览 1.4k
第一种 #include<stdio.h> #include<stdlib.h> #include<string.h> char st[110];//用来记录数字的 char s[100]; int main() { gets(s); int len = strlen(s); for (int i = 0; i < len; i++) { if (s[i] >= '0' && s[i] <= '9') { st[i] = 1; } } for (int ...
FCC
2024年3月14日 21:21
字符移动 题解:静态char数组的输入输出、求长度
P1012
回复 0
|
赞 0
|
浏览 1.3k
#include <bits/stdc++.h> using namespace std; int main(){ char ch[100]; //定义char类型字符数组 cin >> ch; //输出非数字字符 for( int i=0; i < strlen(ch); i++ ){ //strlen()求字符串长度 if( !( ch[i] >= '0' && ch[i] <= '9' ) ) //字符比较,而非整形比较,故加'' cout << ch[...
easymoney
2024年3月13日 11:42
字符移动 题解:
P1012
回复 0
|
赞 0
|
浏览 1.4k
#include <stdio.h> #include <string.h> int main() { static char a[100], b[100]; int j = 0; gets(a); for(int i = 0;a[i] !='\0';i++){ if (a[i] < '0...
yczhou
2024年3月10日 21:46
字符移动 题解不是数字直接输出,数字存到另一个数组最后输出
P1012
回复 0
|
赞 0
|
浏览 1.4k
#include<stdio.h> int main(){ char num[100],str[100]; char *p=num,*q=str; gets(str); while(*q!='\0'){ if(*q>='0'&&*q<='9') &nbs...
Yw1111111
2024年3月5日 22:53
字符移动 题解:Python
P1012
回复 0
|
赞 0
|
浏览 1.2k
while True: try: str = input() digit_text = "" other_text = "" for char in str: if char.isdigit(): digit_text += char else: other_text += char text = other_text + di...
orderrr
2024年2月24日 17:08
字符移动 题解:
P1012
回复 0
|
赞 1
|
浏览 1.4k
#include <bits/stdc++.h> using namespace std; /* 思想: 1、两次循环 2、第一遍将非数字依次头插入到新的字符数组 3、第二遍将数字再头插到数组中 */ int main() { char c[100]; fget...
DestinyCares+++
2024年2月23日 16:12
字符移动 题解:标记法
P1012
回复 0
|
赞 1
|
浏览 1.6k
#include<iostream> #include<string> #include<cstring> using namespace std; int a[105] = { 0 }; int main() { string str; getline(cin,str); for (int i = 0; i < str.size();i++) { ...
1
2
3
4
5
6
题目
字符移动
题解数量
56
发布题解
在线答疑
热门题解
1
字符移动 题解:
2
字符移动 题解:C
3
字符移动 题解:
4
字符移动 题解:
5
字符移动 题解:简洁版
6
字符移动 题解:
7
字符移动 题解:
8
字符移动 题解:
9
字符移动 题解:
10
题解:字符移动