repositories
/
TD_C.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
59f37ea
)
Cleanups.
master
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Mon, 6 Apr 2020 17:13:04 +0000
(19:13 +0200)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Mon, 6 Apr 2020 17:13:04 +0000
(19:13 +0200)
TP_7/exo3/exo3.c
patch
|
blob
|
blame
|
history
diff --git
a/TP_7/exo3/exo3.c
b/TP_7/exo3/exo3.c
index 03d6390a3e56777b072fc06fc5405db06506881a..2008814a45e411ba0929eb30fe508810618efd1c 100644
(file)
--- a/
TP_7/exo3/exo3.c
+++ b/
TP_7/exo3/exo3.c
@@
-1,7
+1,7
@@
#include <stdio.h>
#include <ctype.h>
#include <stdio.h>
#include <ctype.h>
-//FIXME: Comment the code !!!
+//
FIXME: Comment the code !!!
void swap(char* v1, char* v2) {
if (v1 != v2) {
void swap(char* v1, char* v2) {
if (v1 != v2) {
@@
-32,7
+32,7
@@
void permAlphaChar(char* str, int key) {
char alphabet[26] = "abcdefghijklmnopqrstuvwxyz";
int str_length = stringLength(str);
char alphabet[26] = "abcdefghijklmnopqrstuvwxyz";
int str_length = stringLength(str);
- for (int i = 0; i < str_length; i++) {
+ for (int i = 0; i < str_length; i++) {
//if (str[i] == ' ') continue;
for (int j = 0; j < 26; j++) {
if (str[i] == alphabet[j]) {
//if (str[i] == ' ') continue;
for (int j = 0; j < 26; j++) {
if (str[i] == alphabet[j]) {
@@
-48,16
+48,16
@@
void permAlphaChar(char* str, int key) {
int main() {
char rev_msg[] = "Bonjour le monde";
int main() {
char rev_msg[] = "Bonjour le monde";
- int rev_length = stringLength(rev_msg);
+ int rev_length = stringLength(rev_msg);
char perm_msg[] = "Bonjour a tous et toutes";
char perm_msg[] = "Bonjour a tous et toutes";
- int perm_length = stringLength(perm_msg);
+ int perm_length = stringLength(perm_msg);
printf("La chaine de caracteres a inverser est \"%s\" et a pour longueur %d caractere(s)\n", rev_msg, rev_length);
reverseString(rev_msg);
printf("La chaine inversee de caracteres est \"%s\"\n", rev_msg);
printf("\n");
printf("La chaine de caracteres a inverser est \"%s\" et a pour longueur %d caractere(s)\n", rev_msg, rev_length);
reverseString(rev_msg);
printf("La chaine inversee de caracteres est \"%s\"\n", rev_msg);
printf("\n");
-
+
printf("La chaine de caracteres a permuter est \"%s\" et a pour longueur %d caractere(s)\n", perm_msg, perm_length);
permAlphaChar(perm_msg, 13);
printf("La chaine permutee de caracteres est \"%s\"\n", perm_msg);
printf("La chaine de caracteres a permuter est \"%s\" et a pour longueur %d caractere(s)\n", perm_msg, perm_length);
permAlphaChar(perm_msg, 13);
printf("La chaine permutee de caracteres est \"%s\"\n", perm_msg);