This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int n,i,j; | |
float m[51][50]; | |
cin>>n; | |
for (i = 0; i < n; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string.h> | |
using namespace std; | |
int main() { | |
char s[40]; | |
cin >> s; | |
char v[] = "aeiou"; | |
for (int i = 0; i < strlen(s); i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
int f(int n) { | |
int s = 0, d = 2; | |
while (n > 1) | |
if (n % d == 0) { | |
s++; | |
n = n / d; | |
} else | |
d++; | |
return s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream.h> | |
int main() { | |
int v[100], n = 0, x, i, j, aux; | |
n = 0; | |
ifstream fin("nr.txt"); | |
while (fin >> x) { | |
if (x >= 100) { | |
v[n] = x; | |
n = n + 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i, n, j, a[30][30]; | |
cin >> n; | |
for (i = 0; i < n; i++) | |
for (j = 0; j < n; j++) | |
if (i == j) | |
a[i][j] = 0; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i, n, j, a[30][30]; | |
cin >> n; | |
for (i = 0; i < n; i++) | |
for (j = 0; j < n; j++) | |
if (i + j == n - 1) | |
a[i][j] = 0; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream.h> | |
ofstream f("nr.txt"); | |
void main() { | |
long n; | |
cin >> n; | |
while (n) { | |
f << n << " "; | |
n = n / 10; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
void main() { | |
int n, a[100], s = 0, i; | |
cin >> n; | |
for (i = 1; i <= n; i++) { | |
cin >> a[i]; | |
s = s + a[i]; | |
} | |
for (i = n; i >= 1; i--) { | |
cout << s << " "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream.h> | |
ifstream f("BAC.TXT"); | |
void main() { | |
long x, y, n; | |
f >> x; | |
n = 1; | |
while (f >> y) { | |
if (x == y) | |
n++; | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
#include <string.h> | |
void main() { | |
char s[255]; | |
cin.get(s, 255); | |
char v[] = " aeiou"; | |
int gata = 0, i; | |
i = strlen(s) - 1; | |
while (!gata) // ca sa stearga o singura data | |
{ |
OlderNewer