
#include <iostream>
#include<cmath>
using namespace std;
int main() {
char arr[] = {"us2ststudent123456789"};
char *out;
char *p =arr;
char a[20]="";
char b[20]="";
int i=0,j=0;
while(*p != '\0')
{
if(*p >= 'a' && *p <= 'z')
{
a[i++]=*p;
}else if(*p >= '0' && *p <= '9')
{
b[j++]=*p;
}else{
cout<<"string is not correct"<<endl;
}
p++;
}
cout<<"a: "<<a<<endl;
cout<<"b: "<<b<<endl;
cout<<"i: "<<i<<endl;
cout<<"j: "<<j<<endl;
int index = 0;
if(abs(i-j)
订阅专栏 解锁全文

4万+

被折叠的 条评论
为什么被折叠?



