fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int price = Int.Parse(Console.ReadLine());
  8. int[] coins = {500, 100, 50, 10, 5, 1};
  9. int count = 0;
  10.  
  11. if (price > 100) {
  12. return;
  13. }
  14.  
  15. for (int i = 0; i < coins.Length; i++) {
  16. if (price < coins[i]) {
  17. continue;
  18. }
  19. else{
  20. if (price % coins[i] == 0) {
  21. count++;
  22. }
  23. }
  24. }
  25.  
  26. for (int i = 0; i < coins.Length; i++) {
  27. int leftpay = price - coins[i];
  28.  
  29. if (leftpay < 0) {
  30. continue;
  31. }
  32. else if (leftpay == 0) {
  33. count++;
  34. continue;
  35. }
  36. else {
  37. for (int j = 0; j < coins.Length; j++) {
  38. leftpay -= coins[j];
  39. if (leftpay < 0) {
  40. continue;
  41. }
  42. else if (leftpay == 0) {
  43. count++;
  44. continue;
  45. }
  46. else {
  47. for (int k = j; leftpay < 0; k++) {
  48. leftpay -= coins[k];
  49. if (leftpay == 0) {
  50. count++;
  51. continue;
  52. }
  53. else if (leftpay < 0) {
  54. break;
  55. }
  56. else {
  57. continue;
  58. }
  59. }
  60. }
  61. }
  62. }
  63. }
  64. Console.WriteLine(count);
  65. }
  66. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
10
compilation info
prog.cs(7,17): error CS0103: The name `Int' does not exist in the current context
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty