Dima
lol
Dima
/ban 1305811052
Prince Of Persia
hello guys
how can I use a object in if() statement?
example:
....
MyBool b;
if(b){
cout << "something";
}
....
Alex
Prince Of Persia
Prince Of Persia
Boolean::operator bool() const {
return this->holder;
}
olli
ברני
ברני
olli
ברני
I did index 9 in case he'll do 8
ברני
The tasks asked me to add only one.. If it want more I should add all the indexes, and I think I'll use switch?
ברני
Or I'm wrong?
olli
> in its appropriate place
I guess it depends on your interpretation of "appropriate" - I would have thought you should add it at the next unused index
ברני
Jasur Fozilov 🐳
Delete the smallest element of the stack. does anyone know how to do that?
Anonymous
Hi guys, how can i make a random number in c?
-Bs¬
u can use rand() but idont know how it works
-Bs¬
Just remember that there is no 100% random number
Anonymous
Andrey
Andrey
Anonymous
why are you returning NULL?
Anonymous
char* arr = "...";
Shooting the leg
Andrey
Andrey
Anonymous
Andrey
i can't understand what problem do I have 😕
Anonymous
You have a problem writing in C while not understanding what are you doing
Andrey
so, what do i have to do to fix this problem?
Anonymous
Andrey
First: read a book
ok, but how to fix this problem? to write just arr also doesn't work
⟪ Ⓩub-Er ⟫
Two one-dimensional arrays of different lengths are undefined. Arrays must be at least 50 in size. Assign these strings 2-99 adventurous values. Combine these two arrays into a third one-dimensional array. When combining, pass only non-prime numbers.
Calculation of the number of times each element occurs on the one-dimensional array you combine. Create a new two-dimensional array with the elements you calculated with these values. For example;
Combined array:
10, 20, 15, 10, 8, 12, ...
Two-dimensional array:
a [0] [0] = 10 a [0] [1] = 2
a [1] [0] = 20 a [1] [1] = 1
... like.
Then you output the software to have the first three sequences side by side.
The two dimensional array is "Element - Quantity" analysis one after the other
⟪ Ⓩub-Er ⟫
can you help me?
Anonymous
Anonymous
Tangent Alpha
can you help me?
Bro write the algorithm and then the code, if you have some issues then we can help
Iakovos
Hello guys! I really need your help if you can! I have to write a txt that the output should be like the photo's below. I've been trying for days now but can not fully complete it. I would appreciate if anyone can fill the code for me. (If you run it you could see that only the numbers missing) Thank you in advance!
https://hastebin.com/safimipazo.md
⟪ Ⓩub-Er ⟫
can you write the code i just started the c course
Iakovos
Anonymous
⟪ Ⓩub-Er ⟫
#include <stdio.h>
#include <stdlib.h>
int main() {
int dizi1[10], dizi2[10], toplam[20]={0};
int i;
for(i=0;i<10;i++) {
dizi1[i] = rand()%99+1;
dizi2[i] = rand()%99+1;
}
int durum=1;
int x=0;
while(x < 10) {
for(i=2;i<dizi1[x];i++) {
if(dizi1[x] % i == 0) {
durum = 0;
break;
}
}
if(durum) {
toplam[x] = dizi1[x];
}
x++;
}
int j=0;
while(x < 20) {
for(i=2;i<dizi2[j];i++) {
if(dizi2[j] % i == 0) {
durum = 0;
break;
}
}
if(durum) {
toplam[x] = dizi2[j];
}
x++;
j++;
}
for(i=0;i<10;i++) {
printf("dizi1 %d. sayi %d\n", i, dizi1[i]);
printf("dizi2 %d. sayi %d\n", i, dizi2[i]);
}
for(i=0;i<20;i++) {
printf("%d\n", toplam[i]);
}
}
Anonymous
is that time taken to do ???
Anonymous
Iakovos
Anonymous
What do you mean??
those numbers for random ASC DESC in selection,insertion,shell,quick sort
⟪ Ⓩub-Er ⟫
what
Iakovos
Yeah it is the duration of these methods of sorting, I extracted them from a file
Anonymous
Iakovos
Anyway you could help me if you please?
Anonymous
me noob 😅
Iakovos
Anyone here willing to help?
Raru
I need help in C , who can help me with one problem ?
Dima
is it exams week or what
Dima
lol
Tangent Alpha
Dima
but read the rules first
⟪ Ⓩub-Er ⟫
Hadaward 'Solly'
pastebin
⟪ Ⓩub-Er ⟫
I couldn't do it in two dimensions
Hadaward 'Solly'
put your code in there and share the link here. It's simple and helpful for readers
Raru
This problem i need to do with fuctions but i can’t
Raru
#include <stdio.h>
int a[20][20];
int swich_line(int n,int line_1,int line_2){
int val,i;
for(i=0;i<=n;i++){
val=a[line_1][i];
a[line_1][i]=a[line_2][i];
a[line_2][i]=val;
}
return 0;
}
void main(){
int j,i,m,n,val,sum;
printf("Introduceti numarul de linii: ");
scanf("%d", &n );
printf("Introduceti numarul de coloane: ");
scanf("%d", &m );
while(n<=1 || m<=1 ) {
printf("Conditia n<1 si m<1.");
printf("\nIntrodu n:"); scanf("%d", &n);
printf("Introdu m:"); scanf("%d", &m);
}
sum=0;
for (i=0; i < m; i++)
{
for ( j = 0; j < n; j++)
{printf("Elementul[%d][%d]:", i,j);
scanf("%d", &val);
a[i][j]=val;
if ((val>0) &&((val%2)==0))
{
sum=sum+val;
}
}
a[i][n]=sum;
sum=0;
}printf("\n\n");
for(i=0; i<n; i++)
{
for(j=0; j<m; j++)
printf("%5d", a[i][j]);
printf("\n");
}printf("\n\n");
for(i=0;i<m;i++){
for(j=0;j<m;j++){
if (a[i][n]<a[j][n])
{
swich_line(n,i,j);
}
}
}
for(i=0;i<m;i++){
for(j=0;j<n;j++){
printf("%5d ",a[i][j]);
}
printf("\n");
}
return 0;
}
Dima
read the rules
Hadaward 'Solly'
dima, can you put in the rules "Minimum Requirements: Discrete Math"
Anonymous
What is the full form of conio.h. In #include<conio.h>
Anonymous
Anonymous
Hadaward 'Solly'
Hadaward 'Solly'
i hope you have a fun time with numerical optimizations
Hadaward 'Solly'
but dw, it's prob in a distant future
Anonymous