-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDigital_Fortress.cpp
More file actions
50 lines (49 loc) · 920 Bytes
/
Digital_Fortress.cpp
File metadata and controls
50 lines (49 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include<string.h>
#include <cmath>
using namespace std;
static char arr[10000];
int main()
{ int num_text ;
cin>>num_text;
for(int i =0 ; i <num_text ;i++)
{
int n, y;
float x ;
gets(arr);
for(int j=0;j<10000;j++)
{
if(arr[j]=='\0'&&arr[j]!=' ')
break;
else
n++;
}
cout << n;
x = sqrt((double)n);
y=x;
if(y!=x)
cout<<"INVALID";
/* else
{
char matrix[y][y] ;
int counter=0;
for(int r =0 ; r<y ; r++)
{
for(int c =0 ;c<y ; c++)
{
matrix[r][c]=arr[counter];
counter++;
}
}
for(int r =0 ; r<y ; r++)
{
for(int c =0 ;c<y ; c++)
{
cout<<matrix[c][r];
}
}
}
*/
}
return 0;
}