Write a program that prompt the user to input a four digit positive interger. The program then output the digit of the number, one digit per line. For example, if the input is 3245, the is
3
2
4
5
Thanks...
In a bank there are two types of transactions: credit and debit. All transactions are assigned an alphabetical ID. Credit transactions are assigned a vowel and debit transactions are assigned a consonant. To track transactions over a year, all the transaction IDs are combined to form a string of IDs for each customer. A customer wishes to know the number of times he made a debit transaction immediately after a credit transaction.
Write an algorithm to print the count of debit transactions that were made immediately after a credit transaction for that particular customer.
Input
The first line of the input consists of a string userString, representing the string of transaction IDs.
Output
Unimart is offering a dhamaka offer. Terms and conditions to gain the offer as follows: Unimart will provide a shopping bag which you can carry W weight at maximum load. (If you try to load more than W weight then it will fall on the ground and you will lose the offer forever) Unimart has N < 10 products with weight w1, w2, w3...etc. You can get only 1 product for each item. Input: W N maximum weight and number of products. Find the set of products and their sum so that you can use the maximum weight of your bag capacity. N integers represent weight product P1, P2....Pn. Output: Print selected products set and the sum of these products. Sample Input: 10 4 8 9 2 4 20 4 10 7 4 5 90 8 23 10 1 7 2 3 4 5 Sample Output: 8 2 Sum: 10 10 5 4 Sum: 19 23 10 1 2 3 4 5 7 Sum: 55 Output product set sequence doesn't matter but you have to find the optimal sum of weight so that maximizes the profit.