public int GetNumberAtPos(int pos)
{
if(pos==0||pos==1)
{
return 1;
}
int res = GetNumberAtPos(pos - 1) + GetNumberAtPos(pos - 2);
return res;
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _9._26
{
class program
{
protected int i = 10;
static void Main(string[] args)
{
program p = new program();
p.i = 20;
Console.WriteLine(p. i);
Console.ReadKey();
}
}
}
#define NULL 0
#include<iostream>
using namespace std;
struct student
{
int num;
int score;
struct student *next;
};
void main()
{
student a,b,c,*head,*p;
a.num=1;a.score=10;
b.num=2;b.score=20;
c.num=3;c.score=30;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
cout<<p->num<<" "<<p->score<<endl;
p=p->next;
}
while(p!=NULL);
system("pause");
}