All pastes #759652 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-03 11:29 UTC
rendered paste body
#include <stdio.h>
#define N 80
int main (int argc, char *argv[]) 
{
int i,j,k,f,test;
char str[N],rts[N];


printf("dwste to string sas \n");
scanf("%79s", str);                     /*vrika to mikos tou string*/


for (i=0; str[i]!='\0'; i++)  
{}
k=i-1;                                  /*vrika to telos tou string kai to vazw sto k*/


for (i--,j=0; i>=0; i--,j++)            /*evala ton str anapoda ston rts, diladi ta stoixeia tou str anapoda ston rts*/
{rts[j]=str[i];}                        /*me auto ton tropo, afou o enas pinakas exei anapoda ta stoixeia tou allou,  */
                                        /* tous elegxw ap tin arxi. Stous karkinikous pou einai simmetrikoi, 8a exoun ta idia stoixeia*/
rts[j]='\0';                            /*dinw telos ston rts*/


f=0;                                    /*dinw arxiki timi stin f*/
for (i=0; i<=k; i++)
{
    if (str[i]=rts[i])                 /*molis vrw str diaforo tou rts, allazw tin timi tou f*/
    {f=1;}
    
}
if (f=0)                               /*elegxw me vasi to f an einai karkiniki i oxi*/
{printf("karkiniki");}
else {printf("mi karkiniki");}
scanf("%d", &test);
return (0);
}