View Code of Problem 77

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    char a[999];
    cin>>a;
    for(int i=0;i<strlen(a)-1;i++){
        cout<<a[i]<<" ";
    }
    cout<<a[strlen(a)-1]<<endl;
    return 0;
}



/*
Main.cc: In function 'int main()':
Main.cc:7:27: error: 'strlen' was not declared in this scope
     for(int i=0;i<strlen(a)-1;i++){
                           ^
Main.cc:10:21: error: 'strlen' was not declared in this scope
     cout<<a[strlen(a)-1]<<endl;
                     ^
*/

Double click to view unformatted code.


Back to problem 77