Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

#include <stdio.

h>
#include <stdlib.h>
#include <string.h>

#define MAX_FJALI_GJATESIA 20

int numer_preseritjesh(const char *fjalia, char shkronja) {


int count = 0;
for (int i = 0; i < strlen(fjalia); i++) {
if (fjalia[i] == shkronja) {
count++;
}
}
return count;
}

int main(int argc, char *argv[]) {


if (argc != 3) {
printf("Usage: %s <input_file> <output_file>\n", argv[0]);
return 1;
}

char shkronja;

FILE *file1;
file1 = fopen(argv[1], "r");

if (file1 == NULL) {
printf("Gabim gjatë hapjes së file-it.");
return 1;
}

FILE *file2;
file2 = fopen(argv[2], "w");

if (file2 == NULL) {
printf("Gabim gjatë hapjes së file-it.");
return 1;
}

printf("Shkruani shkronjën që doni të kontrolloni: ");


scanf(" %c", &shkronja); // Shto hapësirën për të injoruar karakterin newline
char fjala[MAX_FJALI_GJATESIA + 1]; // +1 për null terminator-in

while (fscanf(file1, "%s", fjala) != EOF) {


int numer_preseritjesh_shkronja = numer_preseritjesh(fjala, shkronja);
fprintf(file2, "%s - %d\n", fjala, numer_preseritjesh_shkronja);
}

fclose(file1);
fclose(file2);

printf("Operacioni u krye me sukses. Rezultatet janë ruajtur në file-in %s.\n",


argv[2]);

return 0;

ight recognized
}

planets orbing
the Sun. In order
from the closest
to the
Sun:Mercury,
Venus, Earth,
Mars, Jupiter,
Saturn, Uranus,
and Neptune.
These planets
dier in
size,composion,
atmosphere, and
other
characteriscs.
Dwarf Planets
: Apart from the
eight planets,
there are also
recognized dwarf
planets in the
solarsystem.
Pluto, Eris,
Haumea,
Makemake, and
Ceres are among
the notable ones.
Moons
: Many of the
planets,
including some
dwarf planets,
have moons (or
natural
satellites)orbing
around them.
Earth's Moon is
the most well-
known, but
Jupiter's moon
Ganymede is
thelargest moon
in the solar
system.
Asteroids and
Comets
: The solar
system also
contains numerou
s asteroids,
rocky remnants
from theearly
formaon of the
system, found
mostly in the
asteroid
belt between
Mars and
Jupiter.
Comets,made of
ice, dust, and
rocky material,
have highly
ellipcal orbits
that somemes
bring them
close tothe Sun.
Space Debris
: There's a vast
amount of debris
in the solar
system, including
smaller rocks,
dustparcles, and
remnants from
various celesal
events like
collisions or
the remnants of
planetesimals.
Orbital Dynamics
: The planets
orbit the Sun in
ellipcal paths,
following
Kepler's laws of
planetarymoon.
Each planet has
its unique
orbital period
and distance
from the Sun.
Exploraon
: Various missions
have been
launched
to explore
dierent celesal
bodies

You might also like