Competitive Coding 1: Array Input When Size of Array is Not Given | 2D-Array | Compaloon

preview_player
Показать описание
This is our first video on competitive coding.

Here we show how to take array input when the length of the input is not given. In this video we also demonstrate how to use this method to take 2-D array as input if the size of the array is not given.

Feel free to comment down below if you have any doubts or suggestions.
Рекомендации по теме
Комментарии
Автор

CODE:
#include <iostream>
using namespace std;

int main()
{
int i=0;
string str[100];
while(getline(cin, str[i]))
i++;
int arr[100][100]={0}, I;
for(int j=0;j<i;j++)
{
I=0;
for(int l=0;l<str[j].size();l++)
{
if(str[j][l]==' ')
I++;
else

}
}
for(int j=0;j<i;j++)
{
for(int l=0;l<=I;l++)
cout<<arr[j][l]<<" ";
cout<<endl;
}
return 0;
}

Compaloon
Автор

brother continue the series of competetive coding

devendrathakur
Автор

Can u please share the link of the ide you are using? I was looking for this kind of online ide, it would be very helpful. BTW, this video was immensely helpful.

sreyashisaha
Автор

how to take input if input is given in followig format:
0101
1011
ie there is no space between digits
these inputs are of 2d array
can you help??

ayushijindal
Автор

Keep the code handy in the comment through link on GitHub. 🤘

rakshitkathawate
Автор

i want this code in java bro. could you please help?

venkatchinnapuvvula
Автор

thanq u so much bro but i am not getting the output in 1-d array can u please help

UIEC_MANESH_RAM-tbhb