M
M
max volin2020-12-10 22:43:13
C++ / C#
max volin, 2020-12-10 22:43:13

How to make a word appear in a column?

#include <iostream>
#include <string>
#include <iomanip>
#include <cmath>
using namespace std;
int main ( )
{
char *s;     
s = new char[50];          
cin >> s;
int d = 0;
while (*s++) d++; 
cout <<  d;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Ananiev, 2020-12-11
@kamiyada

for(int i=0; i < 50; i++)
{
if(s[i]=='\0') break;
 cout << s[i]<< endl;
}

M
MrColdCoffee, 2020-12-10
@MrColdCoffee

cout << d \n;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question