int main() {
char sir_de_caractere[100];
int i, j;
printf("Introduceti cuvantul: ");
for (i = 0; i < 100; i++) {
scanf ("%c", &sir_de_caractere[i]);
if(sir_de_caractere[i] == 10) {
sir_de_caractere[i] = '\0';
break;
}
}
int len = strlen(sir_de_caractere);
for (i = 0; i < len; i++) {
int x = i % 2;
int y = i / 2;
for (j = i + 1 - x - y; j < len - i + y; j++) {
printf("%c", sir_de_caractere[j]);
}
printf("\n");
}
return 0;
}
//2//
#include <stdio.h>
#include <string.h>
int main() {
char sir_de_caractere[100];
int i, j;
printf("Introduceti linia de text: ");
for (i = 0; i < 100; i++) {
scanf ("%c", &sir_de_caractere[i]);
if(sir_de_caractere[i] == 10) {
sir_de_caractere[i] = '\0';
break;
}
}
int len = strlen(sir_de_caractere);
for (i = 0; i < len; i++) {
j = (int)sir_de_caractere[i];
if ((j > 64 && j < 91) || (j > 96 && j < 123)) {
printf("%c", sir_de_caractere[i]);
}
}
printf("\n");
return 0;
}
// 3//
#include <stdio.h>
#include <string.h>
int main() {
char sir_de_caractere[100], car;
int i, frecventa = 0;
printf("Introduceti linia de text: ");
for (i = 0; i < 100; i++) {
scanf ("%c", &sir_de_caractere[i]);
if(sir_de_caractere[i] == 10) {
sir_de_caractere[i] = '\0';
break;
}
}
printf("Introduceti caracterul pentru care se va calcula frecventa: ");
scanf("%c", &car);
int len = strlen(sir_de_caractere);
for (i = 0; i < len; i++) {
if (sir_de_caractere[i] == car) {
frecventa++;
}
}
printf("Frecenta de aparitie a caracterului %c este: %d.\n", car, frecventa);
return 0;
}
// 4///
#include <stdio.h>
#include <string.h>
int main() {
char sir_de_caractere[100];
int i, j, k, x = 0;
printf("Introduceti propozitia terminata cu punct: ");
for (i = 0; i < 100; i++) {
scanf ("%c", &sir_de_caractere[i]);
if(sir_de_caractere[i] == 10) {
sir_de_caractere[i] = '\0';
break;
}
}
int len = strlen(sir_de_caractere);
for (i = 0; i < len; i++) {
j = (int)sir_de_caractere[i];
if (j == 32 || j == 46) {
for (k = x; k < i; k++) {
printf("%c", sir_de_caractere[k]);
}
x = i + 1;
printf("\n");
}
}
Please edit your post and make sure your code is [code]between code tags[/code] so that it has line numbers and syntax highlighting, as well as proper indentation.
You have forgotten to ask a question. We can't give help unless you tell us what you are having issues with.