#include<stdio.h> int main() { char a[3]={'1','2','3'}; int b[3]={0}; for(int i=0;i<3;i++) { b[i]=a[i]-'0'; printf("b[%d]=%d\n",i,b[i]); } return 0; }
#include<iostream> #include<cstring> using namespace std; int main() { char a[100]; int b[100]; int length; cin>>a; length = strlen(a) ; cout<<length<<endl; for (int i=0; i<length; i++) { b[i] = a[i] - '0'; cout<<b[i]; } return 0; }