Anonymous
what if one is casted to long long and other to double
Anonymous
But duplicating code is overwhelming
Anonymous
Anonymous
why?
Anonymous
Because there are C++ rules
Anonymous
Learn about implicit type casting in expressions
Anonymous
I don't know how it's called properly
Anonymous
What led you guess that the result will be long long and not double?
Anonymous
Anonymous
And because it's kinda obvious
Rashi
Hey ... Does anybody know how to debug RE(SIGFPE) error in C program ? It's a run time error
Rashi
#include<stdio.h>
int main()
{
int t;
long long n,k,apples_per_block1=0,apples_per_block2=0,apples_in_a_row2=0;
scanf("%d",&t);
while(t--){
scanf("%lli %lli",&n,&k);
if(n>=1&&k!=0&&n%k==0){
apples_per_block1=n/k;
if(k*k>n)
printf("YES\n");
else{
apples_in_a_row2=k*k;
apples_per_block2=k;
if(n%apples_in_a_row2==0)
printf("NO\n");
else
printf("YES\n");
}
}
}
return 0;
}
Rashi
Rashi
Any help ?
sambit
Anybody can give c tutorials
🎩
🎩
your code doesn't seem to be printing out anything
🎩
5 int t;
6 long long n, k, apples_per_block1 = 0, apples_per_block2 = 0, apples_in_a_row2 = 0;
7 scanf("%d", &t);
-> 8 while (t--)
9 {
10 scanf("%lli %lli", &n, &k);
11 if (n >= 1 && k != 0 && n % k == 0)
Target 0: (teleChannelDebug) stopped.
(lldb) print t
(int) $5 = 16438
right now when you initialzied t like that and minus off in while loop, it's taking a long time. 3rd point mentioned by @crxz0193 I think
🎩
you gotta change your loop
Rashi
Rashi
While loop ?
🎩
yep
Rashi
What's wrong in that ? And how can I correct it ?
Anonymous
Get list of numbers in 2 arrays.find the identical integers from that 2 array and sort the final list in ascending order. Pls share the program
Anonymous
5 int t;
6 long long n, k, apples_per_block1 = 0, apples_per_block2 = 0, apples_in_a_row2 = 0;
7 scanf("%d", &t);
-> 8 while (t--)
9 {
10 scanf("%lli %lli", &n, &k);
11 if (n >= 1 && k != 0 && n % k == 0)
Target 0: (teleChannelDebug) stopped.
(lldb) print t
(int) $5 = 16438
right now when you initialzied t like that and minus off in while loop, it's taking a long time. 3rd point mentioned by @crxz0193 I think
main.cpp:1:1: error: expected unqualified-id before numeric constant
5 int t;
^
main.cpp:2:4: error: expected unqualified-id before numeric constant
6 long long n, k, apples_per_block1 = 0, apples_per_block2 = 0, apples_in_a_row2 = 0;
^
main.cpp:3:4: error: expected unqualified-id before numeric constant
7 scanf("%d", &t);
^
main.cpp:4:1: error: expected unqualified-id before ‘->’ token
-> 8 while (t--)
^~
Dima
Lol o.O
Czar
Rashi
I have done it
Rashi
Czar
Do you have testcase?
🎩
not sure what you're trying to achive but if your loop should always have a range. Initialize t as int. @CourageousTouch
int t = 2147483648;
while (t > 0)
{
/*code*/
t--;
}
Czar
t is scanf prior to loop
🎩
oh
🎩
sorry i'm not too familiar with scanf. but is that a user input?
Czar
Yes, it's user input. Normally used in number of testcase to expect. Standard in many competitive programming website
Anonymous
Anonymous
Any recommended resources that teaches or manifest things in a smooth understandable way?
ابھی سنگھ
Hi
Dima
/warn We have a free pdf warn
Krishna@Kishan
Hello how to use vs code
Mat
Anonymous
Who Know about vb.net application
Mayur
Sorry
Anonymous
Anonymous
Anyone can help me in my assignment topic vb.net
Anonymous
Anonymous
Anonymous
because it is offtopic
I_Interface
Anonymous
I just can't unstarstand what is so hard in following the rules
Anonymous
Anonymous
Dima
Dima
thanks
Anonymous
thanks
I think Rose deserves her own title, like you have one already
Dima
Yeah I suggested that
Dima
Tho I can’t see it for myself
Anonymous
Hi guys I'm a new member in this group
klimi
Dima
I think I should be more specific tho.
ابھی سنگھ
Anyone can help me in c
Dima
Anonymous
What is that group for?
Anonymous
Can anyone suggest me a Light weight IDE for C++ in MACOS?
I've been using Sublime Text + Terminal.
klimi
klimi
mac... xcode
Anonymous
Anonymous
xcode is heavy
Anonymous
too heavy
Anonymous
Dima
Dima
or CLion
Dima
CodeLite also.