For this question, we should use #q=mCDeltaT#, where #q# is heat gained or lost, #m# is mass, #C# is specific heat, and #DeltaT# is temperature change.
#q# would be #"45.1J"#. #m# would be #"1.2g"#. #DeltaT# would be #"final - initial" = 80 - 50 = "30°C"#.
Let's plug that into #q=mCDeltaT# to solve for #C#:
#"45.1J" = "1.2g" xx C xx 30°C# #C = "45.1J" / ("1.2g" xx 30°C)# #C = 1.25277778 = "1.3J/g°C"#