Article View: fr.comp.lang.c
Article #15231Re: rot13 [Was : Re: conjugaison et autres ...]
From: Eric Levenez
Date: Sun, 02 Oct 2005 19:38
Date: Sun, 02 Oct 2005 19:38
37 lines
2650 bytes
2650 bytes
Le 2/10/05 20:52, dans <43402c57$0$1702$8fcfb975@news.wanadoo.fr>,
��candide�� <candide@domain.invalid> a �crit�:
> #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;
> }
Tu n'as pas de C beautifuler sur ta machine ?
Sans un \n final ou un flush, ce code pourrait tr�s bien ne rien afficher du
tout.
--
�ric L�v�nez -- <http://www.levenez.com/>
Unix is not only an OS, it's a way of life.
Technical Details
Message-ID:
<BF6603ED.46C8E%new@levenez.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed.icl.net!proxad.net!infeed-4.proxad.net!news18-e.free.fr!not-for-mailReferences:
<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!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed.icl.net!proxad.net!infeed-4.proxad.net!news18-e.free.fr!not-for-mail User-Agent: Microsoft-Entourage/11.2.0.050811 Date: Sun, 02 Oct 2005 21:38:53 +0200 Subject: Re: rot13 [Was : Re: conjugaison et autres ...] From: Eric Levenez <new@levenez.com> Newsgroups: fr.comp.lang.c Message-ID: <BF6603ED.46C8E%new@levenez.com> Thread-Topic: rot13 [Was : Re: conjugaison et autres ...] Thread-Index: AcXHiOt5KcnXLDN8EdqswgARJC39yA== 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> Mime-version: 1.0 Content-type: text/plain; charset="ISO-8859-1" Content-transfer-encoding: 8bit Lines: 38 Organization: Guest of ProXad - France NNTP-Posting-Date: 02 Oct 2005 21:38:53 MEST NNTP-Posting-Host: 82.244.40.208 X-Trace: 1128281933 news18-e.free.fr 21718 82.244.40.208:51168 X-Complaints-To: abuse@proxad.net