Problem Description
Write a program using pointers to insert a value in an array.Input and Output Format:Refer sample input and output for formatting specification.All float values are displayed correct to 2 decimal places.All text in bold corresponds to input and the rest corresponds to output.CODING ARENA
- #include <stdio.h>int main(){int j,i,n,b;scanf("%d", &n);int a[n];for (i=0;i<n;i++){scanf("%d",&a[i]);}scanf("%d", &b);scanf("%d", &j);for (i=n-1;i>=j-1;i--){a[i+1] = a[i]; }a[j]=b;for (i=0;i<=n;i++){printf("%d\n",a[i]);}return 0;}
Test Case 1
Input (stdin)399 199 2993991Expected Output99399199299Test Case 2
Input (stdin)41 2 3 452Expected Output12534
The winner of the card game popular in Berland "Berlogging" is determined according to the following rules. If at the end of the game there is only one player with the maximum number of points, he is the winner. The situation becomes more difficult if the number of such players is more than one. During each round a player gains or loses a particular number of points. In the course of the game the number of points is registered in the line "name score", where name is a player's name, and score is the number of points gained in this round, which is an integer number. If score is negative, this means that the player has lost in the round. So, if two or more players have the maximum number of points (say, it equals to m) at the end of the game, than wins the one of them who scored at least m points first. Initially each player has 0 points. It's guaranteed that at the end of the game at least one player has a positive number of points.
ReplyDeleteInput
The first line contains an integer number n (1n1000), n is the number of rounds played. Then follow n lines, containing the information about the rounds in "name score" format in chronological order, where name is a string of lower-case Latin letters with the length from 1 to 32, and score is an integer number between -1000 and 1000, inclusive.
Output
Print the name of the winner.
TEST CASE 1
INPUT
3
mike 3
andrew 5
mike 2
OUTPUT
andrew
Code
DeleteThanks for the help in the above mentioned program.
ReplyDeleteBro enakkum above mentioned program ku solution sollunga plz
DeletePoor
ReplyDeletecan u give codings for the above mentioned program
ReplyDeleteReversing string with out library
ReplyDeleteHow to serch the program
ReplyDeleteI'M TOTALLY FREE FROM HEPATITIS B
ReplyDeleteI’m Stephanie Brown, I was diagnosed with Hepatitis B 4 years ago, I lived in pain with the knowledge that I wasn't going to ever be well again. I have used several antiviral medications, but this could not fight the virus of me rather I got side effects of fever, muscle and joint pain. After spending so much money on antiviral drugs but I never get better. I made research on the internet for herbal medicine. AS I was determined to get my lifestyle back and to be able to do things I am restricted from doing, I saw a lady’s post on how Herbal Dr. JAMES cured her of HIV with his herbal mix medicine. I contacted the same Doctor through his email....Drjamesherbalmix@gmail.com....we spoke, I told him all that I have been going through, and he told me not to worry that everything will be better again, so he prepared his herbal mix medicine and sent it to me through DHL courier company and told me the usage, after 21 days of completing the herbal medicine, I was totally free from Hepatitis B, I went to see a doctor for a blood test, After taking a sample of my blood for the test the result came out negative, I just can’t deny that I’m the happiest woman on earth this very moment, I’m so happy and thanks to Herbal Doctor JAMES,He also told me he cures diseases such as Alzheimer's disease, schizophrenia, Autism. Bipolar disorder, Shingles, Melasma, Underactive thyroid, Melanoma, Cancer, Weak Erection, Wart Remover, HPV, Herpes, Fibromyalgia, HIV, Hepatitis b,Liver/Kidney Inflammatory, Epilepsy, Fibroid, Diabetes,COPD, Back pain, Nephrotic syndrome,Infertility.Cardiovascular diseases.lung diseases,Thyroid disorders ,PCOS,Contact him on his email and get rid of your diseases, he is a good man Email....Drjamesherbalmix@gmail.com
Very informative for more C programs you can check C programs here
ReplyDeleteThank you for giving such an informative information; it would be beneficial to both old and new students for improved preparation. I appreciate your efforts in making such a valuable resource available to everyone. C Programming Notes For BCA Students
ReplyDeleteTechokids offers Python coding classes for kids online from Highly Selective With Strong Technical and Industry Background, Experienced Mentors.
ReplyDeleteNice Blog! I really loved reading through this Blog... Thanks for sharing.......
ReplyDeleteAwesome Blog thanks for share your valuable information
Inwizards Technology - Internet of Things IoT
iot development company
hire iot developer