Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int tong;
- tong = boi3(3);
- tong += boi5(5);
- System.Console.WriteLine(tong);
- System.Console.ReadLine();
- }
- public static int boi3(int temp)
- {
- if (temp < 1000)
- {
- return temp + boi3(temp + 3);
- }
- else
- return 0;
- }
- public static int boi5(int temp)
- {
- if (temp < 1000)
- {
- if (temp % 3 == 0)
- return boi5(temp + 5);
- else
- return temp + boi5(temp + 5);
- }
- else
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement