๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15227

Re: rot13 [Was : Re: conjugaison et autres ...]

#15227
From: Harpo
Date: Sun, 02 Oct 2005 19:04
33 lines
2350 bytes
candide wrote:

> /*--------------- rot13.c (2eme version) -----------------*/
> #include <stdio.h>
> #include <ctype.h>
> 
> 
> int main(void)
> {
>     char minus[]="abcdefghijklmnopqrstuvwxyzabcdefghijklm";
>     char majus[]="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM";
>     char phrase[200]="Preface : The computing world has undergone a
> revolution since the publication of \"The C Programming Language\" in
> 1978.";
>     int i=0;
>     char *p;
>     
>      while (phrase[i]!='\0') {
>                      if (islower(phrase[i]))
>                      {p=strchr(minus,phrase[i]);
>                      {printf("%c",*(p+13));}
>                      else if (isupper(phrase[i]))
>                      {p=strchr(majus,phrase[i]);
>                      {printf("%c",*(p+13));}
>                      else printf("%c",phrase[i]);
>                      i++;
>                      }
>        
>    return 0;
> }
> /*----------------------------------------------------------*/

Ca devrait marcher partout, mais le strchr( ) est assez co๏ฟฝteux.
Technical Details
Message-ID: <43402f38$0$1733$8fcfb975@news.wanadoo.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail
References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr> <43402c57$0$1702$8fcfb975@news.wanadoo.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,b21b26167a936e28
X-Google-Attributes: gidf9822,public
X-Google-Language: ENGLISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!freenix!news.wanadoo.fr!news.wanadoo.fr!not-for-mail
Message-ID: <43402f38$0$1733$8fcfb975@news.wanadoo.fr>
From: Harpo <trashcan@hotmail.com>
Subject: Re: rot13 [Was : Re: conjugaison et autres ...]
Newsgroups: fr.comp.lang.c
Date: Sun, 02 Oct 2005 21:04:20 +0200
References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr> <43402c57$0$1702$8fcfb975@news.wanadoo.fr>
Organization: ARG ; Association pour la Rehabilitation du Goto
User-Agent: KNode/0.8.2
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8Bit
Lines: 34
NNTP-Posting-Date: 02 Oct 2005 21:04:24 CEST
NNTP-Posting-Host: 83.195.242.183
X-Trace: 1128279864 news.wanadoo.fr 1733 83.195.242.183:33697
X-Complaints-To: abuse@wanadoo.fr