Anonymous
The user will identify the teams and the players lefts overs. Write the pseudocode and draw the corresponding flowchart given the following conditions;
How many players do you wish per team?
(Enter a value in the range 9-15):4
Team size should be 9 to 15 players.
How many players do you wish per team? 12
How many players are available: -142
Please enter a positive number: 142
There will be 11 teams with 10 players left over.
Alex
What about )( or even {[}] ??
)( - check every time is closed. initial value - 0. check ')' - decrement 0 = -1; -1 is less than 0, so this is error. about multiquotes it depends on task
Roshan
Anonymous
Roshan
Roshan
Anyone else having a different approach than mine?
Alex
you could use also stack: push for (, and pop for ). in the end stack must be empty
Roshan
mov $22, %rax
int euclides(int a, int b)
{
a += b -= a = b - (a = a % b);
if(!b)
return a;
return euclides(a, b);
}
mov $22, %rax
Can you do better?
I_Interface
I_Interface
mov $22, %rax
mov $22, %rax
mov $22, %rax
:(
Anonymous
_waͣrͬdͩaͣdͩdͩy_
Anonymous
At least variable names are not bad
Roshan
_waͣrͬdͩaͣdͩdͩy_
Macros, typedefs, so much spaces
Actually the code is a generalized framework which I used for Competitive Programming thats why its like that although from CP perspective its still readable.
_waͣrͬdͩaͣdͩdͩy_
Anonymous
Guys, why can't you be cuddly like sheep?
I_Interface
Roshan
Anonymous
But you guys creep me out. I don't dare post any question unless I ultimately got no solution .
mov $22, %rax
Roshan
Shvmtz
Where can I get the best implementation for data structures ?
Anonymous
Igor🇺🇦
mov $22, %rax
Anonymous
Anonymous
Cristi
#include<stdio.h>
#include<stdlib.h>
int* Suma(int **a,int nl, int nc)
{
int i,j,Sum;
int *b;
b=(int *)malloc(nc*sizeof(int));
for (i=0; i<nc; i++){
Sum = 0;
for (j=0;j<nl;j++){
Sum = Sum + a[j][i];
}
b[i] = Sum;
}
return b;
}
int main(){
int i, nl, nc;
int *b;
puts("Give the number of rows:");
scanf("%d",&nl);
puts("Give the number of columns:");
scanf("%d", &nc);
// Alloc memory to 2D array
int **a = (int **)malloc(nl *sizeof(int*));
for(i=0;i<nl;i++){
a[i] = (int *)malloc(nc*sizeof(int));
}
// Form 2D Array
int q,w;
for (q=0;q<nl;q++){
for (w=0;w<nc;w++)
a[q][w] = rand()%100-50 ;
}
// Show 2D array
int e,r;
for (e=0;e<nl;e++){
for (r=0;r<nc;r++) {
printf ("%d\t", a[e][r] );}
printf("\n"); }
// Call Function
b = Suma(a, nl, nc);
printf("\nElements of array: \n");
for (int l;l<nc;l++){
printf("%d", b[l]);
}
}Why the last operation (show elements of 1D array from function) doesen't work ?
Lava
Do Anti-virus softwares reduce IDE execution time ? I used one and now even a hello takes 40-60 sec to run .
Dima
Anonymous
just use linux
Less software library compared to windows and I can't keep up with its daily updates.
Dima
Lava
I am compiling on gcc just I think the anti virus softwares is causing it to take a long time to run.
cout<<"Hello";
took 45 seconds
Anonymous
True but less of the popular, would require making lots of adjustments.
Lava
Ou ok
Anonymous
your anti-virus software might be checking every executable, why not test it by temporarily stopping your anti virus? if yes, well there it is.
Anonymous
Anonymous
If u r using windows defender , make an exception for the folder where the compiled files are stored in..
Dima
> using antivirus software in 2020 🤔🤔
Anonymous
Anonymous
I don't know but I feel that lol is a stupid statement and less probable, except if you don't mind people calling you crazy for most scenes.
A simple funny-depicting emoji should do.
Just saying, you know?
Anonymous
Anonymous
hi
Anonymous
i’ve got a problem to programs in C++ with struct
Anonymous
can you help me?
I_Interface
can you help me?
Don't ask for ask.
Type your question about a problem at the first place.
Anonymous
I’ve a programme where C++ is created in language a structure carrier of 10 elements of this kind: a char and a int . It is: to load the elements into the carrier by asking for values from the user; to print all elements of the carrier; it is intended to add all the entire parts contained in the codes and print the sum by video.
I_Interface
Anonymous
i’ve
using namespace std;
#include<stdio.h>
#include <stdiolib.h>
system (“color F5”);
main (){
struct code N[10]{
int m;
char f;
and now? what I can do? I MUST Continue it
Anonymous
Anonymous
Your struct syntax is off.
struct code { // something };
declare "struct code N[10]" either in global or local
I_Interface
Anonymous
Also I don't understand what "carrier" means.
I_Interface
Anonymous
Anonymous
I’ve a italian track not english, and google traslate has translate like this