UVA solution 490 - Rotating Sentences - Solution in C,C++ - Online Judge Solution

Latest

It is a free Online judges problems solution list. Here you can find UVA online Judge Solution, URI Online Judge Solution, Code Marshal Online Judge Solution, Spoz Online Judge Problems Solution

Monday, May 22, 2017

UVA solution 490 - Rotating Sentences - Solution in C,C++

UVA Solution  490 - Rotating Sentences - Volume 4


UVA Online Judge Solution  490 - Rotating Sentences | Volume 4
UVA Problem Link - 490 - Rotating Sentences solve

Problem Name:  490 - Rotating Sentences code
Problem Number : UVA -  490 - Rotating Sentences solution
Online Judge : UVA Online Judge Solution
Volume: 4
Solution Language : C plus plus

UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list

UVA Solution  490 - Rotating Sentences Code in CPP:

#include <stdio.h>
#include <string.h>

int main() {
    char s[105][105], c[105][105];
    int n = 0, m = 0, i, j;
    while(gets(s[n]))
        n++;
    memset(c, ' ', sizeof(c));
    for(i = 0; i < n; i++) {
        for(j = 0; s[i][j]; j++)
            c[j][n-i-1] = s[i][j];
        m = m > j ? m : j;
    }
    for(i = 0; i < m; i++) {
        c[i][n] = '\0';
        puts(c[i]);
    }
    return 0;
}


Tags: UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list, UVA 490 code in C, UVA  490 - Rotating Sentences code in C++, UVA  490 - Rotating Sentences solution in C, UVA 490 solution

1 comment: