Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/
#include <stdio.h>
int main()
{
int n, tmp = 0, RPM, cnt = 0, ans = 0, cndtn = 1;
scanf("%d", &n);
while(n--)
{
scanf("%d", &RPM);
cnt++;
if(RPM<tmp && cndtn==1)
{
ans = cnt;
cndtn = 0;
}
tmp = RPM;
}
printf("%d\n", ans);
return 0;
}
I didn't undesrtand nothing!
ReplyDelete#include
ReplyDeleteint main()
{
int n,i,pos=0;
scanf("%d",&n);
int A[n];
for(i=0;iA[i+1])
{
pos=i+2;
break;
}
}
printf("%d\n",pos);
return 0;
}
//where is my problem? where is the 10% wrong?
Same with you
Deletein problem 2167
ReplyDeletei could understand this veriable ,,cndtn = 1;
#include
ReplyDeleteint main()
{
int n,i,a=0;
scanf("%d",&n);
int arr[n*2];
for(i=0;i<=n-1;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<=n-1;i++)
{
if(arr[i]>arr[i+1])
{
a=i+1+1;
break;
}
}
printf("%d\n",a);
return 0;
}
what is the problem
#include
ReplyDeleteint main()
{
int n,i,a=0;
scanf("%d",&n);
int arr[n];
for(i=0;i<=n-1;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<=n-1;i++)
{
if(arr[i]>arr[i+1])
{
a=i+1+1;
break;
}
}
printf("%d\n",a);
return 0;
}
what is the prblm with this one?