1 solutions

  • 0
    @ 2025-11-5 19:32:06

    C :

    #include <stdio.h>
    #include<string.h>
    int main()
    {
    	int i;
     	char str[100];
    	gets(str);
    	for(i=strlen(str)-2;i>=0;i--)	
    	printf("%c",str[i]);
    	printf("\n");
    }
    
    

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    string a;
    int main()
    {
    	getline(cin,a,'#');
    	for(int i=a.size()-1;i>=0;i--)
    		cout<<a[i];
    	return 0;
    }
    

    Pascal :

    var a:array[0..101]of char;i,n:integer;
    begin
     n:=0;
     while a[n]<>'#'do
      begin
       inc(n);
       read(a[n])
      end;
     readln;
     dec(n);
     for i:=n downto 1 do
      write(a[i]);
     writeln
    end.
    
    • 1

    Information

    ID
    19359
    Time
    1000ms
    Memory
    32MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By