Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Problem: fb_series
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); int a = 0; int b = 1; int c = 0; string s=""; for (int i = 2; i < n; i++) { c= a + b; s += c; a= b; b= c; } Console.WriteLine(s.IndexOf(n); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
1
Before Number big
Multi-Dimensional Array
GP-TIME
Ejercicio bucles
Polygon Util
Stacks: Balanced Brackets
Math Main
MIXED CONTENT - string and numbers separation in a large string
SDAXXX
Please log in to post a comment.